View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bryan Bryan is offline
external usenet poster
 
Posts: 114
Default Random Number Genarator

well the array is what is throwing me off. i need my numbers to be in a
range of say 25 rows 30 columns.

"Joel" wrote:

to generate unique random number, you need to check the list of previous
number to make sure the number wasn't previously picked.

The other method is to create a llist of number 1-1000 (either in an array
or on the spreadsheet). Assign a random number to each of the 1000 number (2
dimensional array or 2nd column of spreadsheet). Then sort the list by the
random numbers.

Selecting a random cell is choosing a random number. If you had cells A1:A70

Randrow = int(70 * rnd()) + 1

Range("A" & RandRow).select

"Bryan" wrote:

I need to be able to generate a random sample of numbers, say 1-1000. no
number can be repeated. i can generate the sample, but i have duplicates.
what i am looking for is to be able to not have duplicates.

also, if i had to select a random cell out of this sample, how would i go
about doing that?