Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Address = "$D$6" Or Target.Address = "$D$7" Or Target.Address = "$D$8" Then
If Range("$D$6") = 1 Then
Shapes("Rouge").Fill.ForeColor.RGB = RGB(255, 0, 0)
Else
Shapes("Rouge").Fill.ForeColor.RGB = RGB(255, 255, 255)
End If
If Range("$D$7") = 2 Then
Shapes("Orange").Fill.ForeColor.RGB = RGB(255, 255, 0)
Else
Shapes("Orange").Fill.ForeColor.RGB = RGB(255, 255, 255)
End If
If Range("$D$8") = 3 Then
Shapes("Vert").Fill.ForeColor.RGB = RGB(0, 255, 0)
Else
Shapes("Vert").Fill.ForeColor.RGB = RGB(255, 255, 255)
End If
End If
' variante
If Target.Address = "$D$26" Then
Shapes("Rouge2").Fill.ForeColor.RGB = RGB(255, 255, 255)
Shapes("Orange2").Fill.ForeColor.RGB = RGB(255, 255, 255)
Shapes("Vert2").Fill.ForeColor.RGB = RGB(255, 255, 255)
If Target.Value = 1 Then
Shapes("Rouge2").Fill.ForeColor.RGB = RGB(255, 0, 0)
ElseIf Target.Value = 2 Then
Shapes("Orange2").Fill.ForeColor.RGB = RGB(255, 255, 0)
ElseIf Target.Value = 3 Then
Shapes("Vert2").Fill.ForeColor.RGB = RGB(0, 255, 0)
End If
End If
End Sub