Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Random select entries
I have a list of names, phone numbers, etc. The list is over 5,000 entries
long. I need to randomly select 1100 of them. Is there a way to do this in excel? I know how to randomly select one. Better still, can I randomly select and highlight 1100 entires? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Random select entries
Assuming the list of entries are in column a the code below will
highlight as many as you specify. It's also set up to summarize the data it highlighted in column b HTH Owen Sub RandomSelect() Dim iCount As Long Dim i As Long Dim iOffset As Long Dim iRange As Long Dim bUnique As Boolean iRange = Application.WorksheetFunction.Count(Range("A:A")) iCount = InputBox("Enter the number of random values to pull") Range("A:A").Interior.ColorIndex = xlNone Range("b:b").ClearContents For i = 1 To iCount Do iOffset = Rnd() * iRange If Range("A1").Offset(iOffset, 0).Interior.ColorIndex = 6 Then bUnique = False Else Range("A1").Offset(iOffset, 0).Interior.ColorIndex = 6 bUnique = True Range("b1").Offset(i, 0) = Range("A1").Offset(iOffset, 0) End If Loop Until bUnique = True Next i End Sub brodiemac wrote: I have a list of names, phone numbers, etc. The list is over 5,000 entries long. I need to randomly select 1100 of them. Is there a way to do this in excel? I know how to randomly select one. Better still, can I randomly select and highlight 1100 entires? |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Random select entries
Hey OWEN,
Can you please explain this step by step including which cells to put which formulas in? I'm having a little difficulty understanding the process. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cannot select a chart on an Excel worksheet | Charts and Charting in Excel | |||
Random Number response | Excel Worksheet Functions | |||
Random numbers to make a known amount | Excel Worksheet Functions | |||
how do you "select locked cells" w/o "select unlocked cells"? | Excel Discussion (Misc queries) | |||
How do I Select Multiple entries from Valid list for a Cell | Excel Discussion (Misc queries) |