AlexanderBB
Well-known Member
- Joined
- Jul 1, 2009
- Messages
- 1,835
- Office Version
- 2019
- 2016
- Platform
- Windows
I found this via Google but just wonder if it's correct
Because if I send in a Top of 29 and a low of 0 I have found it will return 30
VBA Code:
Public Function randomvalue(top As Integer, low As Integer)
Randomize ' Initialize random-number generator.
randomvalue = CInt((top - low + 1) * Rnd + low) ' Generate random value between low and top.
End Function