Sub Tirage()
Dim T, S, i%, j%, C%, N%
DL = Range("C65500").End(xlUp).Row
Range("J4:M" & DL).ClearContents
Application.ScreenUpdating = False
T = Range("C4:H" & DL): ReDim S(UBound(T), 2)
For C = 1 To 4
For i = 1 To UBound(S)
Randomize
S(i, 1) = i: S(i, 2) = 100 * Rnd()
Next i
For i = 1 To UBound(S)
For j = 1 To UBound(S)
If S(j, 2) < S(i, 2) Then
buffer = S(j, 1): S(j, 1) = S(i, 1): S(i, 1) = buffer
buffer = S(j, 2): S(j, 2) = S(i, 2): S(i, 2) = buffer
End If
Next j
Next i
N = 0
For i = 1 To UBound(T)
If T(S(i, 1), C + 2) = "W" Then
Cells(S(i, 1) + 3, C + 9) = "X"
N = N + 1
If N = 7 Then Exit For
End If
Next i
Next C
End Sub