Comparing Updated files

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Each day I receive an updated Excel file. The file is large and only minor
differences occur each day. How can I see the differences quickly or
automatically?
 
Bob,
How are any differences to be indentified?

One way:

=IF(COUNTIF(Range1, A2)=0,"new record","old record")

"Range1" is a column in the "old" sheet which is compared to column A to the
"new" sheet. Put formula in a "helper" column and copy down.
 
Assume we have two files, new.xls and old.xls.
Each has a sheet named s1. Open both files and run:

Sub checkdif()
Set wbo = Workbooks("old.xls")
Set wbn = Workbooks("new.xls")
Set so = wbo.Sheets("s1")
Set sn = wbn.Sheets("s1")
For Each r In sn.UsedRange
vn = r.Value
vo = so.Range(r.Address).Value
If vo <> vn Then
r.Interior.ColorIndex = 6
End If
Next
End Sub

The macro will hi-light in yellow all the cells in new.xls that are
different than old.xls
 
Does this not assume (which may correct!) that the files sizes (row and/or
columns) are the same?
 
Absolutely !! The structure must be the same ! If rows/columns are
added/deleted there will be a huge pile of mis-matches
 
Back
Top