Bonsoir à tous
je bricole ce code pour essayer de faire changer la couleur de ma cellule mais je ne m'en sors pas...
Une lumière pourrait m'éclairer ?
merci d'avance
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
Dim Cellule As Range
Set Range = ("R10:U17")
'If Not Application.Intersect(Target, Range("R10:U17")) Is Nothing Then
For Each Cellule In Range
If Cellule.Value = 0 Then
Cellule.Offset(0, 0).Interior.Color = RGB(255, 0, 0)
Cellule.Offset(0, 0).Font.Color = RGB(255, 0, 0)
ElseIf Cellule.Value = 1 Then
Cellule.Offset(0, 0).Interior.Color = RGB(255, 0, 0)
Cellule.Offset(0, 0).Font.Color = RGB(255, 0, 0)
ElseIf Cellule.Value = 2 Then
Cellule.Offset(0, 0).Interior.Color = RGB(64, 64, 64)
Cellule.Offset(0, 0).Font.Color = RGB(64, 64, 64)
'ElseIf Cellule.Value = 3 Then
'Cellule.Offset(0, 0).Font.Color = RGB(255, 0, 0)
'Cellule.Offset(0, 0).Font.Color = RGB(255, 0, 0)
End If
Next Cellule
End If
End Sub