Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I keep from repeating a number in the same column? Stephanie Excel Discussion (Misc queries) 3 September 6th 07 10:48 PM
how do i check if a number is repeating anier614 Excel Discussion (Misc queries) 4 August 17th 07 03:26 PM
Repeating Number Sly Excel Worksheet Functions 1 July 28th 07 10:44 PM
How do I randomize ascending data (number values) in excel? Christa Excel Worksheet Functions 1 September 12th 05 09:28 PM
Random Number Non Repeating ... a_ryan1972 Excel Discussion (Misc queries) 3 April 6th 05 09:26 PM


All times are GMT +1. The time now is 07:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"