Possible to randomize number between value....

User avatar
sal21
PlatinumLounger
Posts: 4059
Joined: 26 Apr 2010, 17:36

Possible to randomize number between value....

Post by sal21 »

How to return a randomized number between 1 to 24?

for example:
1
22
4
12
24
...

User avatar
StuartR
Administrator
Posts: 12028
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: Possible to randomize number between value....

Post by StuartR »

You could define a function like this...

Code: Select all

Function RandBetween(LowLimit As Integer, HighLimit As Integer) As Integer

    RandBetween = Int((HighLimit - LowLimit + 1) * Rnd) + LowLimit
       
End Function
StuartR