View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Otto Moehrbach
 
Posts: n/a
Default Comparison of records between two spreadsheets

Carolyn
You can use the following macro. Make sure the first sheet, the sheet
that has all the data, is the active sheet. I assumed in this macro that
the sheet with the missing data is named "Two". Change that as you wish.
This macro loops through all the entries in Column A (starting with A2) of
the first sheet and checks if that entry is in Column A of the second sheet.
If it is NOT, the macro will color that cell in the first sheet RED. Change
the color as you wish also. HTH Otto
Sub FindMissingRecords()
Dim ColAOne As Range
Dim ColATwo As Range
Dim i As Range
Set ColAOne = Range("A2", Range("A" & Rows.Count).End(xlUp))
With Sheets("Two")
Set ColATwo = .Range("A2", .Range("A" & Rows.Count).End(xlUp))
End With
For Each i In ColAOne
If ColATwo.Find(What:=i.Value, LookAt:=xlWhole) Is Nothing Then
i.Interior.ColorIndex = 3
Next i
End Sub
"Carolyn at VW" <Carolyn at wrote in message
...
We have two spreadsheets that are identical, one went through a filtering
process in an attempt to automate the reporting of the records. After
doing
so we are noticed there were a number of records missing. Instead of
manually going through the sheets, we would like to set something up to
automatically tell us which records/rows are missing from the other sheet.