Hello bigjim,
This program does what you described.
My output said ( team numbers for all 30 people)
6,2,6,4,4,6,1,6,1,6,2,5,2,5,4,3,2,3,4,3,5,3,5,2,3,1,1,4,1 and 5.
5 people in each of the 6 teams.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Option Base 1
Sub team()
'30 people, 6 teams
Dim myarray As Variant
Dim mycount As Integer
Dim mytemp As Variant
'fill the array
myarray = Array(1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2,
3, 4, 5, 6, 1, 2, 3, 4, 5, 6)
For i = 1 To 30
Randomize
staticrnd = Rnd
kount = Int((31 - i) * Rnd()) + 1
'MsgBox "kount" & kount
Number = 0
For j = 1 To 30
If myarray(j) > 0 Then
Number = Number + 1
End If
If Number = kount Then
MsgBox "team" & myarray(j)
myarray(j) = 0
Exit For
End If
Next j
Next i
End Sub
------------------------------------------------------------------
The output is not very sophisticated, you have to push it thrue bit by bit.
It assigns 30 people (1-30) to 6 teams.
Each time you run it the output is different.
Good Luck!
Gabor Sebo