Use this formula in a cell and fill down as necessary...
=Rand() * 100
The free "Special Randoms" workbook available here... http://excelusergroup.org/media/
can generate random numbers and text in several unique ways.
--
Jim Cone
Portland, Oregon USA
"helen" <[email protected]>
wrote in message
I would like to know how to generate some quick random numbers
in order to use for demo purposes.
This will put 50 unique random integers in column A. Right click your sheet
tab, view code and paste this in and run it
Sub No_Repeats()
Dim MyRange As Range
Set MyRange = Range("A1:A50")
For Each c In MyRange
Do
c.Value = Int((9999 * Rnd) + 1)
Loop Until WorksheetFunction.CountIf(MyRange, c.Value) < 2
Next
End Sub
Neat code but why did you suggest making it a worksheet macro rather than a
general one?
best wishes
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.