Bonjour,
Je ne connais pas la programmation VBA, mais j'en ai eu besoin pour créer une macro, j'ai donc bêtement copié-collé un code trouver sur internet.
Ma macro fonctionne mais le message d'erreur exécution '13' incompatibilité de type apparaît souvent, je ne sais pas pourquoi.
De plus j'aimerai appliquer ma macro à l'ensemble des feuilles de mon classeur mais je n'y arrive pas.
voici ma macro:
Private Sub Worksheet_Change(ByVal Target As Range)
For Each ws In Worksheets
Chaine = Target.Value
With Target.Interior
If InStr(Chaine, "DS") Then .ColorIndex = 4
If InStr(Chaine, "FDS") Then .ColorIndex = 45
If InStr(Chaine, "EE") Then .ColorIndex = 7
If InStr(Chaine, "Echo") Then .ColorIndex = 6
If InStr(Chaine, "Bilan") Then .ColorIndex = 3
If InStr(Chaine, "CS") Then .ColorIndex = 8
End With
End Sub
merci de bien vouloir m'aider, c'est un dossier de boulot urgent.
diane
Je ne connais pas la programmation VBA, mais j'en ai eu besoin pour créer une macro, j'ai donc bêtement copié-collé un code trouver sur internet.
Ma macro fonctionne mais le message d'erreur exécution '13' incompatibilité de type apparaît souvent, je ne sais pas pourquoi.
De plus j'aimerai appliquer ma macro à l'ensemble des feuilles de mon classeur mais je n'y arrive pas.
voici ma macro:
Private Sub Worksheet_Change(ByVal Target As Range)
For Each ws In Worksheets
Chaine = Target.Value
With Target.Interior
If InStr(Chaine, "DS") Then .ColorIndex = 4
If InStr(Chaine, "FDS") Then .ColorIndex = 45
If InStr(Chaine, "EE") Then .ColorIndex = 7
If InStr(Chaine, "Echo") Then .ColorIndex = 6
If InStr(Chaine, "Bilan") Then .ColorIndex = 3
If InStr(Chaine, "CS") Then .ColorIndex = 8
End With
End Sub
merci de bien vouloir m'aider, c'est un dossier de boulot urgent.
diane