View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
merjet merjet is offline
external usenet poster
 
Posts: 812
Default Marking records with mismatched data

If I understood it correctly, the following answers your 1st question.
Your 2nd question wasn't clear enough for me, but you can probably
answer it yourself using the following as a guide.

Hth,
Merjet


Sub Macro1()
Dim c1 As Range
Dim c2 As Range
Dim rng1 As Range
Dim rng2 As Range
Dim iEnd As Long
Dim bFound As Boolean

iEnd = Sheets("Sheet1").Range("B65536").End(xlUp).Row
Set rng1 = Sheets("Sheet1").Range("B10:B" & iEnd)
iEnd = Sheets("Sheet2").Range("A65536").End(xlUp).Row
Set rng2 = Sheets("Sheet2").Range("A2:A" & iEnd)
For Each c2 In rng2
bFound = False
For Each c1 In rng1
If c1 = c2 Then
bFound = True
If c1.Offset(0, -1) < "O" Then c2.Interior.ColorIndex = 6
End If
Next c1
If bFound = False Then c2.Interior.ColorIndex = 3
Next c2

End Sub