Bonjour,
j'ai fait une macro en prenant plusieurs idée sur le site, mais j'ai 2 problèmes avec :
1 j'aimerai metter la police en blanc pour les couleurs foncées .
2 quand j'efface une celleulle excel m'afficjhe un message d'erreur
voici la marco :
Private Sub Worksheet_Change(ByVal Target As Range)
Chaine = Target.Value
With Target.Interior
If InStr(Chaine, "RH") Then .ColorIndex = 15
If InStr(Chaine, "TP") Then .ColorIndex = 48
If InStr(Chaine, "cr") Then .ColorIndex = 4
If InStr(Chaine, "avi") Then .ColorIndex = 6
If InStr(Chaine, "vian") Then .ColorIndex = 7
If InStr(Chaine, "diet") Then .ColorIndex = 10
If InStr(Chaine, "pf") Then .ColorIndex = 12
If InStr(Chaine, "lég") Then .ColorIndex = 43
If InStr(Chaine, "RTT") Then .ColorIndex = 39
If InStr(Chaine, "xxx") Then .ColorIndex = 40
If InStr(Chaine, "AM") Then .ColorIndex = 22
End With
End Sub
merci à vous
j'ai fait une macro en prenant plusieurs idée sur le site, mais j'ai 2 problèmes avec :
1 j'aimerai metter la police en blanc pour les couleurs foncées .
2 quand j'efface une celleulle excel m'afficjhe un message d'erreur
voici la marco :
Private Sub Worksheet_Change(ByVal Target As Range)
Chaine = Target.Value
With Target.Interior
If InStr(Chaine, "RH") Then .ColorIndex = 15
If InStr(Chaine, "TP") Then .ColorIndex = 48
If InStr(Chaine, "cr") Then .ColorIndex = 4
If InStr(Chaine, "avi") Then .ColorIndex = 6
If InStr(Chaine, "vian") Then .ColorIndex = 7
If InStr(Chaine, "diet") Then .ColorIndex = 10
If InStr(Chaine, "pf") Then .ColorIndex = 12
If InStr(Chaine, "lég") Then .ColorIndex = 43
If InStr(Chaine, "RTT") Then .ColorIndex = 39
If InStr(Chaine, "xxx") Then .ColorIndex = 40
If InStr(Chaine, "AM") Then .ColorIndex = 22
End With
End Sub
merci à vous
Dernière édition: