Sub Tirage_sort2()
Dim LMax As Long, N°Maxi As Long, N°Omis As Long, T(), L As Long, A As Long
LMax = Feuil2.[E1].Value
N°Maxi = Feuil2.[E2].Value
N°Omis = Feuil2.[E4].Value
Randomize
ReDim T(1 To LMax, 1 To 2)
With New ListeAléat
Do While L <= LMax
.Init N°Maxi
.Supprimer N°Omis
For L = 1 To LMax
If L <> N°Omis Then
A = .Aléat: If A = L Then Exit For
.Supprimer A
T(L, 1) = L: T(L, 2) = A
End If
Next L
Loop
End With
Feuil2.Columns("A:B").ClearContents
Feuil2.[A1].Resize(LMax, 2).Value = T
End Sub