julien clerc
XLDnaute Junior
bonjour à tous j'aimerais modifier ma vba afin d'afficher une combinaison en rouge
ex: 1 2 3 4 = rouge
merci de m'aider
ex: 1 2 3 4 = rouge
merci de m'aider
Sub combinaisons()
lin = 1
col = 1
For m = 1 To 20
For n = m + 1 To 20
For o = n + 1 To 20
For p = o + 1 To 20
For q = p + 1 To 20
Cells(lin, col) = m & " " & n & " " & o & " " & p & " " & q
If Cells(lin, col) = "1 2 3 4 5" Then
Cells(lin, col).Font.ColorIndex = 3
End If
lin = lin + 1
If lin < 65536 Then
col = col + 1
lin = 1
End If
Next q
Next p
Next o
Next n
Next m
End Sub
Sub combinaisons()
Application.ScreenUpdating = False
Cells.ClearContents
lin = 1
col = 1
For m = 1 To 49
For n = m + 1 To 49
For o = n + 1 To 49
For p = o + 1 To 49
For q = p + 1 To 49
Cells(lin, col) = m & " " & n & " " & " " & o & " " & p & " " & q
lin = lin + 1
If lin > 1000 Then
col = col + 1
lin = 1
End If
Next q
Next p
Next o
Next n
Next m
Application.ScreenUpdating = True
End Sub