Sub BtTirage1_Cliquer()
tirageausort2 1
End Sub
Sub BtTirage2_Cliquer()
tirageausort2 6
End Sub
Sub BtTirage3_Cliquer()
tirageausort2 11
End Sub
Sub tirageausort2(cx)
Dim T, T2, I&, C, LIg&, maxlig&
With Sheets("Inscription"): T = Application.Transpose(.Range("A7", .Cells(Rows.Count, "A").End(xlUp)).Value): End With
maxlig = Round(UBound(T) / 2)
ReDim T2(1 To UBound(T), 1 To 4)
For I = 1 To UBound(T): x = Round(1 + (Rnd * (UBound(T) - 1))): temp = T(I): T(I) = T(x): T(x) = temp: Next
C = 1: LIg = 0
For I = 1 To UBound(T):
LIg = LIg + 1: T2(LIg, C) = T(I): If LIg = maxlig Then C = 3: LIg = 0
Next
With Cells(7, cx).Resize(UBound(T2), 4)
.ClearContents
.Value = T2
End With
End Sub