Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Random Number Array
I have a variable number (RecordCount) and I want to select 15 random numbers
from it and stuff them into an array. I suspect the following code won't preclude the possibility of getting repeat numbers. How do I insure that each of the 15 numbers will be unique? Opiton Explicit Option Base 1 Dim Iloop as Double Dim RecordCount as Double For ILoop = 1 To 15 RndNo(ILoop) = Int((RecordCount * Rnd) + 1) Next ILoop -- Ken Hudson |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Random Number Array
I'd start by looking at JE McGimpsey's site:
http://www.mcgimpsey.com/excel/udfs/randint.html Ken Hudson wrote: I have a variable number (RecordCount) and I want to select 15 random numbers from it and stuff them into an array. I suspect the following code won't preclude the possibility of getting repeat numbers. How do I insure that each of the 15 numbers will be unique? Opiton Explicit Option Base 1 Dim Iloop as Double Dim RecordCount as Double For ILoop = 1 To 15 RndNo(ILoop) = Int((RecordCount * Rnd) + 1) Next ILoop -- Ken Hudson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Array? Put values from random columns into 4 | Excel Worksheet Functions | |||
Discrete random numbers into an array? | Excel Programming | |||
How can I match a random number with closest number from sequence? | Excel Worksheet Functions | |||
random mumber array | Excel Programming | |||
How do I find random number in list of random alpha? (Position is. | Excel Discussion (Misc queries) |