السلام عليكم
اخي ابو نصار
كود رائع جداً
وهذا محاولة لإختصار الكود بنفس المضمون
Sub MKARNH_ALI()
Application.ScreenUpdating = False
Range("C2:D2,E2:F65536").ClearContents
Q = [A15000].End(xlUp).Row
For R = 2 To Q
If Application.CountIf([B2:B5000], Cells(R, 1)) = 0 Then
Cells([E15000].End(xlUp).Row + 1, 5) = Cells(R, 1)
End If
If Application.CountIf([A2:A5000], Cells(R, 2)) = 0 Then
Cells([F15000].End(xlUp).Row + 1, 6) = Cells(R, 2)
End If
Next
[C2].Value = [E15000].End(xlUp).Row - 1
[D2].Value = [F15000].End(xlUp).Row - 1
Application.ScreenUpdating = True
MsgBox "الحمد لله", vbInformation, "تمت المقارنة"
End Sub