Thread: Best Method
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
L. Howard Kittle L. Howard Kittle is offline
external usenet poster
 
Posts: 698
Default Best Method

You could try something like this, will give a unique list of random numbers between 1 and 32 listed in A1A20.

Change the c.Value = to suit the range of start and end numbers and adjust the range for the list to suit.

Do not know if it is the best as you request.

Sub sonic1to32()
Dim FillRange As Range, c As Range
Set FillRange = Range("A1:A20")
For Each c In FillRange
Do
c.Value = Int((32 * Rnd) + 1)
Loop Until WorksheetFunction.CountIf(FillRange, c.Value) < 2
Next
End Sub

HTH
Regards,
Howard
"Dennis Tucker" wrote in message ...
What is the best method to make a list of randomized(non-repeating) numbers between a start value and a end value?