View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Anony Anony is offline
external usenet poster
 
Posts: 35
Default how make a random draw of teams of 4 golfers from a list of 40

Run this in a blank worksheet. Pure random number generation.

Sub RandomGroup()
Dim Random
Dim DestCell As Range
Dim i As Long

i = 1
For i = 1 To 40
Set DestCell = ActiveSheet.Cells(i, 1)
Random = Rnd()
Select Case Random
Case Is < 0.25
DestCell = "Team 1"
Case Is < 0.5
DestCell = "Team 2"
Case Is < 0.75
DestCell = "Team 3"
Case Is < 1
DestCell = "Team 4"
End Select
Next i

End Sub

--------
Cheers,
Anony


"romero1st" wrote:

Everey week we have a group of 25 to 40 golfers that want to make a random
draw of teams of 4. How can I do this using Excel