Hi Gurus,
I am using Rnd() function to generate random number in a loop; however, every time I run macro, the same random numbers are repeated. For clarity, I would like to post the following first 3 random numbers which repeat in the same positions.
1. 0.705547511577606
2. 0.533424019813538
3. 0.579518616199493
and so on.
My loop looks like this:
Sub Random()
Dim R as Double, i as Integer
For i = 1 to 1000
R = Rnd() '(1st = 0.705547511577606, 2nd = 0.533424019813538, 3rd = 0.579518616199493)
other codes ...............
Next i
End Sub
My result should be different due to the use of random number but are in fact same. Is it a default pattern to generate random number? I was anticipating random number in every macro run with no repetitions. I appreciate your guidance.
Thank you
Roshan
Bookmarks