merci MFerrand,
je rencontre un autre problème, lorsque la dernière couleur est mise, ça ne change plus hors je voudrais faire une boucle qu'à chaque clic ça change
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Set plage = Union([G4:G20], [M4:M20], [G28:G40])
If Intersect(Target, plage) Is Nothing Then Exit Sub
Cancel = True
If Target.Interior.ColorIndex = xlNone Then
Target.Interior.Color = RGB(20, 148, 20)
Else
If Target.Interior.Color = RGB(20, 148, 20) Then
Target.Interior.Color = RGB(240, 195, 0)
Else
If Target.Interior.Color = RGB(240, 195, 0) Then
Target.Interior.Color = RGB(0, 176, 240)
Else
If Target.Interior.Color = RGB(0, 176, 240) Then
Target.Interior.Color = RGB(255, 255, 255)
Else
If Target.Interior.Color = RGB(255, 255, 255) Then
Target.Interior.Color = RGB(206, 206, 206)
Else
If Target.Interior.Color = RGB(206, 206, 206) Then
Target.Interior.Color = RGB(112, 48, 160)
Else
If Target.Interior.Color = RGB(112, 48, 160) Then
Target.Font.ColorIndex = xlAutomatic
Target.Font.TintAndShade = 0
End If
End If
End If
End If
End If
End If
End If
End Sub