bonsoir à tous,
j'ai "créé" une macro en pompant sur plusieurs sujets et je n'arrive pas à la finir, je voudrais que les cases coloriées en foncé est une police blanche, voici ci dessous la macro :
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
De plus quand quand j'écrit dans une cellule et que je supprime, la cellule ne se remet pas en blanc.
Merci d'avance à ceux qui arriveront à m'aider et à ceux qui vont essayer.
j'ai "créé" une macro en pompant sur plusieurs sujets et je n'arrive pas à la finir, je voudrais que les cases coloriées en foncé est une police blanche, voici ci dessous la macro :
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
De plus quand quand j'écrit dans une cellule et que je supprime, la cellule ne se remet pas en blanc.
Merci d'avance à ceux qui arriveront à m'aider et à ceux qui vont essayer.