Thread: Random number
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jerry W. Lewis Jerry W. Lewis is offline
external usenet poster
 
Posts: 837
Default Random number

The usual way to avoid duplicates is to use two columns: one column
containing the numbers 1 ... 50 and the second column containing random
numbers. Sort both columns based on the second column, and take the
first six numbers from the first column.

Jerry

ed wrote:

How would i set up a macro to generate six random numbers
in consecutive cells between 1 and 50. There cannot be a
any duplicate numbers though?

Thanks in advance for your help.

Ed