1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
| Sub combi()
Dim ligne As Long, v As Integer
v = 44
ligne = 5
Cells(ligne - 1, "E") = 4 'AMMORCAGE num5
Do Until Cells(ligne - 1, "E") = 49
Cells(ligne, "E") = Cells(ligne - 1, "E") + 1
ligne = ligne + 1
Loop 'FIN AMMORCE num5
Do Until r = 44 'DEBUT REPET num5
v = v - 1
Cells(ligne, "E") = Cells(ligne - 1, "E") - v
Do Until Cells(ligne, "E") = 49
Cells(ligne + 1, "E") = Cells(ligne, "E") + 1
ligne = ligne + 1
Loop
Cells(ligne, "D") = 0
ligne = ligne + 1
r = r + 1
Loop 'FIN DE REPET num5
ligne = 5 'DEbut num4
Cells(ligne, "D") = 4
Do Until IsEmpty(Cells(ligne, "E"))
If Cells(ligne, "E") = 49 Then
'v = v + 1
Cells(ligne + 1, "D") = Cells(ligne - 1, "D") + 1
Else
Cells(ligne + 1, "D") = Cells(ligne, "D")
End If
ligne = ligne + 1
Loop
Cells(ligne, "D").Clear 'fin num4
ligne = 5 'DEbut num3
Cells(ligne, "C") = 3
Do Until IsEmpty(Cells(ligne, "D"))
If Cells(ligne, "D") = 48 Then
'v = v + 1
Cells(ligne + 1, "C") = Cells(ligne - 1, "C") + 1
Else
Cells(ligne + 1, "C") = Cells(ligne, "C")
End If
ligne = ligne + 1
Loop
Cells(ligne, "C").Clear 'fin num3
ligne = 5 'DEbut num2
Cells(ligne, "B") = 2
Do Until IsEmpty(Cells(ligne, "C"))
If Cells(ligne, "C") = 47 Then
'v = v + 1
Cells(ligne + 1, "B") = Cells(ligne - 1, "B") + 1
Else
Cells(ligne + 1, "B") = Cells(ligne, "B")
End If
ligne = ligne + 1
Loop
Cells(ligne, "B").Clear 'fin num2
ligne = 5 'DEbut num1
Cells(ligne, "A") = 1
Do Until IsEmpty(Cells(ligne, "B"))
If Cells(ligne, "B") = 48 Then
'v = v + 1
Cells(ligne + 1, "A") = Cells(ligne - 1, "A") + 1
Else
Cells(ligne + 1, "A") = Cells(ligne, "A")
End If
ligne = ligne + 1
Loop
Cells(ligne, "A").Clear 'fin num1
End Sub |