=rand() command

A

Andrea

I have many columns of data for which I need to get random numbers, then
lock them in with the edit, paste special/value commands before sorting. Is
there any way to do this except column by column? It gets the job done, but
it's very tedious and time-consuming? Thanks.
 
P

PeterAtherton

You could use a macro such as:

This fills in decimals
Sub FillRndNos()
Dim c
For Each c In Selection
c.Value = Rnd()
Next
End Sub

This fills in Integers between 1 & 24

Sub Fill2()
For Each c In Selection
c.Value = CInt(Rnd() * 24 + 1)
Next
End Sub

Regards
Peter
 
Top