Compare VBA Code and Forms in Excel files

xlCompare is a tool to compare VBA projects in the Excel files for differences. This VBA diff tool performs comprehensive comparison of your Excel files and gives you detailed color-coded report with highlighted changes. Rich set of options, command line mode, integration with GIT, Perforce and SVN, 3-way comparison of VBA code makes xlCompare ultimate vba diff and merge tool for Excel developers.

Find changes in VBA Projects in the Excel files

How VBA Diff Tool xlCompare compares VBA code in Excel files
VBA Diff Tool (xlCompare©) in the action

Compare VBA Code in Excel files

xlCompare compares VBA projects in the Excel files for differences. You get comprehensive report for the compared VBA code modules.

Compare VBA Forms in Excel files

xlCompare compared Forms and Controls in the VBA projects in the Excel files. If something was changed on the VBA Form, you will be pointed to this modification.

Merge changes in the VBA Code

How to merge changes in the VBA projects? Forget about it if you are using xlCompare. Armed with this tool you don't need to export your code and import it back. All merge operations are done in xlCompare. In a few clicks you will get your job done.

How to compare VBA Code in Excel files for differences

Below we've placed step-by-step instruction on how to compare two Excel files for differences in the VBA code.
  1. Drop your Excel files into xlCompare window from the Windows explorer.
  2. After second file is dropped, xlCompare immediately gives you Comparison Wizard window. Comparison Wizard is a window where you can select pairs of compared worksheets, VBA modules and VBA forms.
    If your workbooks have similar structure - just click Compare button. Otherwise, select VBA tab and make sure that VBA modules are linked properly.
    VBA diff tool | Comparison Wizard
    Complete this Wizard by clicking Compare button.
  3. Results from the compared VBA modules are on your screen
    Compare VBA code
That's all you need to do. Just in a few simple clicks you get results on your screen.
Compare this procedure with the exporting VBA code, that was described above. xlCompare looks much more effective, right?

Merge VBA Code in Excel

Compare VBA code is just a part of the VBA diff process. Usually, you need to see the differences and merge the changes in VBA code after you've found them.
In case of you are going to do it yourself, be ready to export and import all the modules in your Excel files and spend a half of your working day, if you have really large workbook.
xlCompare gives you several options you can use to merge VBA code.

Merge specific lines in VBA code

  1. Select line you need to merge in the VBA Editor
  2. Click the check box before this line
You see that this line appears in the corresponding module.
That's all. If you save the Excel file right now - new VBA code will be saved.

Merge all lines in the VBA code module

  1. Click in the master module, that contains code to be copied and press Ctrl+A. This hotkey selects all lines in the editor.
  2. Click on the any of the checkboxes in this panel.
  3. All the code was copied into the other VBA project.
Save your Excel file to complete the operation.
Looks very simple and easy right?

Compare VBA Forms in Excel workbook

There are only two methods to compare VBA forms in your VBA projects:
  1. Use xlCompare
  2. Compare VBA Forms manually
Second method is just a wasting your time. It is very time-consuming work with high risk of error. So, we don't recommend it.

xlCompare compares VBA Forms as easy as VBA code

xlCompare has own Visual Basic Viewer that shows contents of the Visual Basic project, including all forms and controls. In the screenshot below you see structure of the Form, represented in the hierarchical tree form. You can browse all controls in the native way.
Compare VBA code - browse forms
Browse contents of the VBA project in xlCompare
Look into the image below. xlCompare highlights controls that was added in one of the versions of the Form.
Compare VBA code - added controls

3-way Compare and Merge Tool for Excel Files

xlCompare is a tool that allows to compare 2 Excel files, that have common base version. This is called 3-way comparison.
If you are VBA developer, this is a must have option. xlCompare displays changes made in two different versions and allows to resolve merge conflicts.
In the modern development, where Visual Basic programs has thousands of lines of code, xlCompare saves a lot of time and became an ultimate VBA diff tool.
The screenshot below shows xlCompare in the 3-Files mode. We've compared 3 Excel files for differences and brings you this color coded report.

Modifications detected by xlCompare

  1. Changed lines of code
  2. Conflicts: lines modified in both concurrent versions of Excel file
  3. New lines of VBA code
  4. New functions
3-way comparison for VBA projects in Excel files

I have a question about xlCompare

Please, describe your question or inquiry in the form below. We will be happy to respond you!
Go to top