dhowser
New Member
- Joined
- Mar 29, 2002
- Messages
- 30
I found a VBA code on this message board that works great for generating random numbers down a column.(A4:A13) I would like to know how to modify this code to make it generate across a row.(C4:L4) Any suggestions or help you can provide would be appreciated. Thanks.
Public Sub RandNum()
Randomize
For Each c In Range("A4:A13")
TryAgain: c.Value = (Int((10 * Rnd) + 0))
If Not Range("A2:A" & c.Row - 1).Find(c.Value, LookIn:=xlValues) Is Nothing Then GoTo TryAgain
Next c
End Sub
Public Sub RandNum()
Randomize
For Each c In Range("A4:A13")
TryAgain: c.Value = (Int((10 * Rnd) + 0))
If Not Range("A2:A" & c.Row - 1).Find(c.Value, LookIn:=xlValues) Is Nothing Then GoTo TryAgain
Next c
End Sub