Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
brodiemac
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Owen
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
CJ CJ is offline
external usenet poster
 
Posts: 102
Default 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
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
Cannot select a chart on an Excel worksheet BearsHart Charts and Charting in Excel 1 June 6th 06 02:41 PM
Random Number response Union70 Excel Worksheet Functions 1 April 27th 06 06:27 PM
Random numbers to make a known amount Smeeg Excel Worksheet Functions 8 March 5th 06 01:30 AM
how do you "select locked cells" w/o "select unlocked cells"? princejohnpaulfin Excel Discussion (Misc queries) 3 July 16th 05 03:53 AM
How do I Select Multiple entries from Valid list for a Cell WIDBIS Excel Discussion (Misc queries) 1 June 29th 05 12:53 AM


All times are GMT +1. The time now is 08:06 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"