Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
buidling randomize function that not repeating the same number
Hi,
You posted in programming so here's a macro. Right click your sheet tab, view code and paste the code below in and run it. Change TopNo to the highest value you want and set the range to suit which is currently A1 - A25. Note the TopNo must be = to the cells in the range or they cannot be unique. Sub Marine() Dim TopNo As Long TopNo = 1000 Dim FillRange As Range Set FillRange = Range("A1:A25") For Each C In FillRange Do C.Value = Int((TopNo * Rnd) + 1) Loop Until WorksheetFunction.CountIf(FillRange, C.Value) < 2 Next End Sub Mike "thread" wrote: hi, is there any functionality in excel that its posible to make randomize for a certain group of number and the numbers will not return if appeared already example cell1 rnd()*10=3 cell 2 rnd()*10=2 cell3 rcd()*10=3 <= this option will not appear any idea? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I keep from repeating a number in the same column? | Excel Discussion (Misc queries) | |||
how do i check if a number is repeating | Excel Discussion (Misc queries) | |||
Repeating Number | Excel Worksheet Functions | |||
How do I randomize ascending data (number values) in excel? | Excel Worksheet Functions | |||
Random Number Non Repeating ... | Excel Discussion (Misc queries) |