Sub
CmpIt()
Dim
cl
As
Range, c
As
Range
Sheets(
"Temp"
).UsedRange.Interior.ColorIndex = xlNone
For
Each
cl
In
Sheets(
"Temp"
).UsedRange.Columns
For
Each
c
In
cl.Cells
If
Not
IsEmpty(c)
Then
c.Interior.ColorIndex = TestIf(cl.Column, c)
Next
c
Next
cl
End
Sub
Private
Function
TestIf(mcl
As
Long
, mc
As
Range)
As
Long
Dim
c
As
Range, FA
As
String
Dim
fnd
As
Boolean
TestIf = 3
With
Sheets(
"Check"
).UsedRange.Columns(mcl)
Set
c = .Find(mc.Value, LookIn:=xlValues, LookAt:=xlWhole)
If
Not
c
Is
Nothing
Then
FA = c.Address
Do
fnd =
True
Exit
Do
Set
c = .FindNext(c)
Loop
While
Not
c
Is
Nothing
And
c.Address <> FA
End
If
End
With
If
fnd
Then
TestIf = 4
End
Function