Sub Rotation()
Dim N%, T
Application.ScreenUpdating = False
For N = 1 To 9
Cells(N, "O") = N: Cells(N, "P") = Rnd
Next N
Range("O:P").Resize(9).Sort key1:=Range("P1"), order1:=xlAscending, Header:=xlNo
T = Range("O1:O9"): Range("O1:P9").ClearContents: Range("B4:G12").ClearContents
Cells(3 + T(1, 1), "B") = "X": Cells(3 + T(2, 1), "B") = "X"
Cells(3 + T(3, 1), "C") = "X"
Cells(3 + T(4, 1), "D") = "X"
Cells(3 + T(5, 1), "E") = "X": Cells(3 + T(6, 1), "E") = "X"
Cells(3 + T(7, 1), "F") = "X": Cells(3 + T(8, 1), "F") = "X"
Cells(3 + T(9, 1), "G") = "X"
End Sub