Thread: random?
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dave B[_11_] Dave B[_11_] is offline
external usenet poster
 
Posts: 1
Default random?

Hi,
A friend asked me this question regarding random numbers in VBA
If you run the following code:

Sub rand()
A = 1
For i = 1 To 10
Cells(A, 3) = rnd
A = A + 1
Next i
End Sub

10 random numbers will appear in A1:A10
Now hit the stop (reset) button in the VBA window and run again.
The exact same 'random' numbers appear.

Is this expected?
Is there a work-around?

Regards - Dave.