Private Sub Worksheet_Change(ByVal Target As Range)
Dim Inter As Range, C As Range
Dim DC As Object
Set Inter = Intersect(Target, Me.[_Tb_Etat[Artisan]])
'Sortir si la modif ne concerne pas la colonne "Artisan" du tableau "_Tb_Etat"
If Inter Is Nothing Then Exit Sub
'Dictionnaire des couleurs (fond et police) utilisées
Set DC = CreateObject("Scripting.dictionary")
For Each C In [_Tb_Artisans].Cells
'Couleurs de fond et de police
DC(C.Value) = C.Interior.Color & Chr(9) & C.Font.Color
Next C
'Pour cas de non correspondance ou de cellule vide :
DC("") = 16777215 & Chr(9) & 0
'Mise en forme des cellules de la colonne "Artisan" concernées par la modif
For Each C In Inter.Cells
If DC.exists(C.Value) Then
Col = Split(DC(C.Value), Chr(9))
C.Interior.Color = CLng(Col(0))
C.Font.Color = CLng(Col(1))
Else
Col = Split(DC(""), Chr(9))
C.Interior.Color = CLng(Col(0))
C.Font.Color = CLng(Col(1))
End If
Next C
End Sub