Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Long
Application.ScreenUpdating = False
If Not Intersect(Target, Range("A2:b65535")) Is Nothing Then
For i = 2 To Range("A65536").End(xlUp).Row
If Range("A" & i).EntireRow.Interior.Color = 9763491 Then Range("A" & i).EntireRow.Interior.Color = xlNone
If Range("A" & i).Value <> Range("A" & i).Offset(, 1).Value Then Range("A" & i).EntireRow.Interior.Color = 9763491
Next
End If
Application.ScreenUpdating = True
End Sub
=ET($A1<>"";$B1<>"";$A1<>$B1)
Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Range, v1$, v2$
Set r = Intersect(Target, Range("A2:B" & Rows.Count), Me.UsedRange)
If r Is Nothing Then Exit Sub
For Each r In r.EntireRow.Rows 'si plusieurs cellules sont modifiées
v1 = r.Cells(1).Text: v2 = r.Cells(2).Text
r.Interior.ColorIndex = IIf(v1 <> "" And v2 <> "" And v1 <> v2, 6, xlNone)
Next
End Sub