Russ,
Try this code (untested):-
Sub CreateSameNums()
Dim cl As Long, x As Long
cl = ActiveSheet.UsedRange.Columns.Count + 3
Rnd -2
Randomize 5
For x = 1 To 100
Cells(x, cl) = Int(Rnd(1) * 50)
Next x
End Sub
HTH,
Daniel.
Russ,
I've just tested that code. The Activesheet.Usedrange bit can be deleted. This works:-
Sub CreateSameNums()
Dim cl As Long, x As Long
Rnd -2
Randomize 5
For x = 1 To 100
Cells(x, 1) = Int(Rnd(1) * 50)
Next x
End Sub
Regards,
Daniel.
Daniel,
WOW.
Thank you so much. I won't tell you how long I spent trying to make this work ( it would embarrass me too much). With your example, I now understand what the VBA help on Rnd meant.
Thanks
Russ