#1
|
|||
|
|||
creating unique numbers in excel
Is there a way in Excel using macros or array functions etc that would allow me to create a set of random numbers that would be unique.
The random numbers would not only have to be unique with the current set but also unique with sets from previous dates. For instance you are creating 200 unique numbers per day. Today you wanted 200 unique numbers that was also unique with the previous 200 numbers you created yesterday. The numbers would be in a range from 1000 to 65536. The system would also have to be easily expandable which would allow for easy number generation from day to day. |
#2
|
|||
|
|||
HI,
This is typical type for sorting 5 different numbers. You can change the code to be more than this number (exmaple 2000). Good luck for coding!! Code:
Sub Sorting() Dim Used(10) As Boolean Dim TheRandom As Integer For i1 = 1 To 10 Used(i1) = False Next i1 For i = 1 To 5 Do TheRandom = Int(Rnd(i) * 10) Loop Until Not Used(TheRandom) Used(TheRandom) = True ActiveCell.Offset(i, 0) = TheRandom Next i End Sub Kind Regards Last edited by Bird_FAT; 05-17-2009 at 08:43 AM. Reason: added code brackets |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Pasting numbers: | Darren | Word | 0 | 04-01-2009 11:22 AM |
Page numbers...starting on page 3 | Motiv8td1 | Word | 2 | 02-21-2009 07:21 AM |
Creating Hyperlinks | alicein1derville | Excel | 5 | 02-08-2009 10:31 PM |
Reversed Printing of Numbers in Numbered Documents | HCM1962 | Word | 0 | 09-22-2008 10:39 AM |
Creating a Distrubution List from Excel | webphotogeek | Outlook | 0 | 01-10-2008 11:21 AM |