Sub
tast()
Dim
i
As
Long
Dim
cell
As
Range
With
Sheets(2)
For
i = 2
To
.Cells(.Rows.Count, 1).
End
(xlUp).Row
Set
cell = Worksheets(1).Columns(
"A:A"
).Find _
(What:=.Cells(i, 1).Value, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=
False
, SearchFormat:=
False
)
If
cell
Is
Nothing
Then
.Cells(i, 1).Interior.Color = vbYellow
Next
i
End
With
End
Sub
Sub
Better()
Dim
c
As
Range
With
Sheets(2)
For
Each
c
In
Range(.Cells(2, 1), .Cells(.Rows.Count, 1).
End
(xlUp))
If
WorksheetFunction.CountIf(Sheets(1).Columns(
"A:A"
), c) = 0
Then
_
c.Interior.Color = vbYellow
Next
c
End
With