Every professional VBA developer from time to time needs to compare different versions of his code. Complex
Excel spreadsheets contain thousands lines of Visual Basic Code. Even minor change in code may lead to error
which can take a lot of your working hours to be debugged and resolved. One of the common ways in resolving
such problems is to find version of your spreadsheet where the problem appears and compare it with previous
version. By analysing differences you can quickly find source of the error in your Visual Basic Code. Or you
can remove differences one-by-one and find line of code which produces error.
xlCompare performs this operation quickly and effectively. It
has all features you need for VBA Project comparison. You get complete list of differences with ability to merge
Code, Forms and Controls.
Let's look how
xlCompare works in this case. Open 2 workbooks and press
Compare button.
If you want to compare only selected modules, you should use Compare | VBA Modules command in the menu. This command
compares 2 modules selected in the left and right pane.
xlCompare can be used with any type of the Excel spreadsheet, which has VBA Project - XLS, XLSM, XLA, XLAM.
Compare Visual Basic Modules
Comparison report for VB Modules is in the Difference Browser window. As you know xlCompare
shows all found discrepancies in one window.
In this discrepancy tree xlCompare shows all modules, which are different, deleted modules and added modules.
Equal modules are not shown - they will only waste the difference display. Each discrepancy has explanation -
which sub\function was added or in which sub line was added\removed\modified.
Activate the discrepancy in this list and you'll be pointed into the VBA Code.
In addition to this you get color-coded comparison report in the Visual Basic Code window:
Now you can see all differences in your VBA modules. To merge lines of code you can use checkboxes, linked with
every changed line or block.
In the Difference Browser and in the main menu you can use commands to save comparison report on disk, restart the comparison, switch panes, etc.
Compare Visual Basic Form Objects
VB Project comparison is not complete without Form Controls. This is the most complex task you can get. You need to manually check properties in the Excel for every control
to find and merge the differences. Imagine form with several pages and 20 controls on each one! You can spend hours for this work.
xlCompare Performs this in a few seconds! Form controls are represented exactly as they look on the form:
When comparison is completed, you get color-coded report:
Merge functions are standard for xlCompare - every checkbox in the Difference Explorer means ability to resolve difference.
So, when you check any control - it is added to another workbook.
As you can see,
xlCompare has all features you need
to compare Visual Basic Code in your Excel Spreadsheets.
xlCompare is an ultimate tool for Excel Spreadsheet Comparison