Re : Coloré des cellules en VBA en fonction d'une selection
C'est bon sa fonctionne !!!
Voici ci-dessous le code :
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Value = "SF" Then
Range(Target.Address, Target.Offset(0, 3).Address).Interior.Color = RGB(255, 255, 153)
End If
If Target.Value = "SD" Then
Range(Target.Address, Target.Offset(0, 3).Address).Interior.Color = RGB(158, 215, 250)
End If
If Target.Value = "CD" Then
Range(Target.Address, Target.Offset(0, 3).Address).Interior.Color = RGB(251, 209, 91)
End If
If Target.Value = "GHV" Then
Range(Target.Address, Target.Offset(0, 3).Address).Interior.Color = RGB(185, 253, 208)
End If
If Target.Value = "GL" Then
Range(Target.Address, Target.Offset(0, 3).Address).Interior.Color = RGB(254, 184, 254)
End If
If Target.Value = "TT" Then
Range(Target.Address, Target.Offset(0, 3).Address).Interior.Color = RGB(255, 91, 91)
End If
If Target.Value = "" Then
Range(Target.Address, Target.Offset(0, 3).Address).Interior.ColorIndex = 0
End If
End Sub
Si quelqu’un voit une amélioration à apporter sur ce code je suis preneur….
Encore un grand merci a vous tous....