Bonjour,
Code corrigé
Public Sub ComparePlages() 'Jean-Eric
Dim Arr1, _
Arr2, _
Flag As Boolean, _
i As Long, j As Long, _
cpt As Long
Cells.Interior.Color = xlNone
Application.ScreenUpdating = False
Arr1 = Range("A2:J54").Value
Arr2 = Range("L2:U54").Value
Flag = True
For i = LBound(Arr1, 2) To UBound(Arr1, 2)
For j = LBound(Arr1, 1) To UBound(Arr1, 1)
Debug.Print Cells(j + 1, i).Address & "-" & Cells(j + 1, i + 11).Address
If Not CCur(Arr1(j, i)) = CCur(Arr2(j, i)) Then
Flag = False
Cells(j + 1, i).Interior.Color = RGB(255, 0, 0)
Cells(j + 1, i + 11).Interior.Color = RGB(255, 0, 0)
cpt = cpt + 1
End If
Next j
Next i
If cpt > 0 Then
MsgBox "Vous avez " & cpt & " anomalies(s)." _
& Chr(10) & "Les cellules sont mises en évidence.", 16
Else
MsgBox "Les 2 plages sont identiques.", 64
End If
End Sub