Random
Pass your array to the Sub below, e.g. Shuffle myArray
Hth,
Merjet
Sub Shuffle(strX() As String)
Dim iCt As Integer
Sheets.Add after:=Sheets(Sheets.Count)
For iCt = 1 To 36
Cells(iCt, 1) = strX(1 + Int((iCt - 1) / 6), 1 + (iCt - 1) Mod
6)
Cells(iCt, 2) = Rnd()
Next iCt
Range("A1:B36").Sort Key1:=Range("B1"), Order1:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, DataOption1:=xlSortNormal
For iCt = 1 To 36
strX(1 + Int((iCt - 1) / 6), 1 + (iCt - 1) Mod 6) = Cells(iCt,
1)
Next iCt
Application.DisplayAlerts = False
Sheets(Sheets.Count).Delete
Application.DisplayAlerts = True
End Sub
|