Witam,
Ja bym zrobil tak:
Sub Znajduj()
Dim i As Integer, j As Integer
Dim d1 As Long, d2 As Long
Dim flag As Boolean
Set a1 = Sheets("Spis")
Set a2 = Sheets("Nowy sprzęt")
d1 = a1.Cells(Rows.Count, "A").End(xlUp).Row
d2 = a2.Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To d2
s = a2.Cells(i, 1).Value
flag = False
For j = 1 To d1
If UCase(a1.Cells(j, 1).Value) = UCase(s) Then
a1.Cells(j, 1).Interior.ColorIndex = 8
flag = True
End If
Next j
If flag = False Then a2.Cells(i, 1).Interior.ColorIndex = 3
Next i
End Sub |