Using xlCompare to compare Excel Worksheets.
This article describes some techniques in using xlCompare to compare Excel worksheets.
Compare Workbooks command on the Compare and Merge ribbon performs complete
excel workbook comparison.
It processes all worksheets and vba modules looking for discrepancies.
When comparison is done, results are shown in the Difference Explorer
To make discrepancies representation more suitable, they are grouped by it's source:
In brackets xlCompare shows number of discrepancies. If there are no brackets with number, like in
VBA Projects in this example, there are no discrepancies in this section.
Root node (Balance Sheet(21) in this example) represents worksheet. 21 means, that 21 discrepancy
was found when comparing Balance Sheet worksheet from the first workbook with
Balance Sheet worksheet from the second workbook.
Value 1 and Value 2 columns show cell values and formulas in the Workbook 1 and Workbook 2.
When you select difference in tree, xlCompare shows it in the context of the worksheet:
The Worksheet Window
used to display difference is a feature present
only in the xlCompare
. This tool
shows comparison report exactly as it looks in Excel. You can work with it in the
same way as you are working with your workbook in the Excel application.
Using right click menu in the Difference Explorer window you can:
- save comparison report on the worksheet or tab-delimited text file
- mark selected difference\all differences with color
- get additional information on the difference
- merge different values from both workbooks
- restart the comparison
- switch Workbook 1 with Workbook 2 and restart the comparison
- save one of the compared workbooks