How to generate a random number, in between two given values.
Posted on September 5, 2011
1 2 3 4 5 6 7 8 9 | 'Math - How to generate a random number, in between two given values. 'S = smallest number that it could return 'L = largest number that it could return Option Explicit Private Function Random(ByVal S As Long, ByVal L As Long) As Long Random = CLng(Rnd * (L - S + 1)) + S) End Function |