Salut Sweetee,
Bien le bonjour MFerrand,
je suppose que la fonction des couleurs n'est pas de servir de décoration mais d'être utiles à quelque chose : cliquables, par exemple...
La photo étant, à mon sens, inexploitable, j'ai réalisé, inspiré par le code fourni par Sweetee, ce à quoi je pensais depuis le début.
Private Sub Worksheet_Change(ByVal Target As Range)
'
Dim tColor()
'
Application.ScreenUpdating = False
'
tColor = Array(RGB(255, 255, 255), RGB(200, 190, 200), RGB(110, 50, 160), RGB(215, 230, 190), RGB(255, 190, 0), _
RGB(150, 210, 80), RGB(0, 175, 240), RGB(255, 255, 0), RGB(255, 0, 0), RGB(225, 110, 10), RGB(255, 255, 255))
If Not Intersect(Target, Range("A1")) Is Nothing Then
For x = 0 To UBound(tColor) - 1
Range("M" & [A1] + x).Interior.Color = tColor(x)
Next
End If
'
Application.ScreenUpdating = True
'
End Sub
Private Sub cb_actif_Click()
'
xActif = Not xActif
If xActif Then
cb_actif.Caption = "Actif"
[A1] = ActiveWindow.VisibleRange.Row
Afficher
Else
cb_actif.Caption = "Non actif"
Application.EnableEvents = False
Range("M:M").Clear
[A1] = 0
Application.EnableEvents = True
End If
'
End Sub
A tester, comme on dit...
A+