Modify code to produce unique random numbers
Posted on 2004-08-23
The following code generates a random number
Dim MyValue As Integer
Randomize ' Initialize random-number generator.
MyValue = CInt(Int((6550 - 6546 + 1) * Rnd() + 6546))' Generate random value between 6546 and 6550
How can I use this code such that all the numbers it generates are unique?? I will eventually have a range of approx 100 numbers. My appliction will only require a random selection of about 20 at any one time. Hope this makes sense.