PC Review


Reply
Thread Tools Rate Thread

Assign from a list of names randomly

 
 
bigjim
Guest
Posts: n/a
 
      13th Mar 2010
I would like to randomly assign people to different teams, from a list of
names. For example: I have a list of 30 people and I want to assign them to
six teams of five, randomly. I am running excel 2003.
 
Reply With Quote
 
 
 
 
Jack Leach
Guest
Posts: n/a
 
      14th Mar 2010
> I am running excel 2003.

Have you tried the newsgroup devoted to Excel? This on is for VBA
programming in Microsoft Acccess...

http://www.microsoft.com/communities...&lang=en&cr=us


--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)



"bigjim" wrote:

> I would like to randomly assign people to different teams, from a list of
> names. For example: I have a list of 30 people and I want to assign them to
> six teams of five, randomly. I am running excel 2003.

 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      14th Mar 2010
On Sat, 13 Mar 2010 15:44:04 -0800, bigjim <(E-Mail Removed)>
wrote:

>I would like to randomly assign people to different teams, from a list of
>names. For example: I have a list of 30 people and I want to assign them to
>six teams of five, randomly. I am running excel 2003.


I'd suggest you ask your question in an Excel newsgroup - this group is for a
different program, Microsoft Access.

--

John W. Vinson [MVP]
 
Reply With Quote
 
ryguy7272
Guest
Posts: n/a
 
      16th Mar 2010
I found this on another post; modified to do what I think you want to do:
Assuming things such as ID in ColA, Name in ColB, Location in ColC ... other
stuff to the right of this. Run this code:
Global Const StartSht = "Sheet1" 'Name of sheet with Name/Location data
Global Const NewSht = "SheetX" 'Name for the new sheet

Sub RandomPicker()
Dim LastRow As Long, Rng As Range, Txt As String
'Delete NewSht if it already exists
On Error Resume Next
Sheets(NewSht).Delete

'Copy StartSht as NewSht
Sheets(StartSht$).Copy Before:=Sheets(1)
ActiveSheet.Name = NewSht$
'Delete all colummns after B.
Columns("D").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Delete Shift:=xlToLeft
'Enter a heading and formula to generate a random number in column C.
Range("D" & HdgRow).Activate
ActiveCell.FormulaR1C1 = "rand"
Range("D" & HdgRow + 2).Activate
ActiveCell.FormulaR1C1 = "=ROUND(RAND()*10000,0)"
'Find the last row of data.
LastRow& = Range("A" & Rows.Count).End(xlUp).Row
'Copy the random number formula down through the last row.
Range("D" & HdgRow + 2).Select
Selection.AutoFill Destination:=Range("D" & HdgRow + 2 & "" & LastRow&)
'Recalc, then copy & paste the random numbers in place as values.
Calculate
Range("D" & HdgRow + 2 & "" & LastRow&).Copy
Range("D" & HdgRow + 2 & "" & LastRow&).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'Assign all the data to a range variable (for convenience).
Set Rng = Range("A" & HdgRow & "" & LastRow&)
'Sort the data by location and random number.
Rng.Sort Key1:=Range("B" & HdgRow), Order1:=xlAscending, Key2:=Range("D" &
HdgRow), _
Order2:=xlAscending, Header:=xlYes, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2:=xlSortNormal

End Sub




--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"John W. Vinson" wrote:

> On Sat, 13 Mar 2010 15:44:04 -0800, bigjim <(E-Mail Removed)>
> wrote:
>
> >I would like to randomly assign people to different teams, from a list of
> >names. For example: I have a list of 30 people and I want to assign them to
> >six teams of five, randomly. I am running excel 2003.

>
> I'd suggest you ask your question in an Excel newsgroup - this group is for a
> different program, Microsoft Access.
>
> --
>
> John W. Vinson [MVP]
> .
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to randomly assign numbers to names? =?Utf-8?B?RW1wcmVzcw==?= Microsoft Excel Misc 6 10th Sep 2006 10:27 AM
How do I randomly sort a list of names? =?Utf-8?B?SklyZWxhbmQ=?= Microsoft Excel Misc 3 17th May 2006 07:39 AM
Assign values to names in a drop-down list? =?Utf-8?B?QmFycnkgTA==?= Microsoft Excel Misc 3 8th Mar 2005 04:21 PM
Suggest name list sheds names randomly =?Utf-8?B?QW5kcmV3IFNrb3VsZGluZw==?= Microsoft Outlook Contacts 4 2nd Mar 2005 12:58 PM
is there any way to randomly create a list of peoples names? =?Utf-8?B?UGhlb25peDg1?= Microsoft Excel Misc 1 29th Oct 2004 02:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:49 PM.