IntroductionContact UsCopyrightOn-line Help LibraryWhich file formats are supportedComparison StrategyxlCompare CommandsFile | OpenFile | Recent ComparisonsCompare | BooksCompare | SheetsCompare | ModulesCompare | OptionsView | LayoutView | Ignore FormattingTools | RecalculatexlCompare ActivationHow to activate xlCompare on the another PC?How to restore xlCompare on my PC?License detailsHow to remove trial limits?General Questions Extended View modeDisplay differences in Extended ViewFilter differencesMerge data from two worksheetsUpdate records on the worksheetDuplicate RemoverGet duplicates between 2 listsExtract Unique RecordsCommand Line modeSave changes in the workbookSave comparison report on diskWorking with TXT and CSV filesFilter data you want to compareIgnore error valuesTrace Formula CalculationsMinimize Difference BrowserSynchronize rows and columnsMark differences (changed cells) with colorDatabase ComparisonCompare worksheets As DatabaseManage Primary KeysHide Equal ModulesFilter cells on the worksheetJoin 2 lists in ExcelFind duplicates in ExcelRemove duplicates in ExcelRemove empty rows on the worksheetBulk Merge operationsBulk Undo operationHighlight only results you needVersion ControlUse xlCompare with SVN to resolve conflictsCompare Visual Basic ProjectsCompare controls on the VB FormsMerge controls on the formsMerge contents of the VBA ModulesI've found a problemSending bugreports to Spreadsheet Tools
How to merge contents of the VBA Modules?
When you compare Visual Basic Modules, it is highly important to not only get the difference, but to resolve it, merge changes effectively. If you are working in the team environment on the spreadsheet model, you merge changes with co-workers very often. If you are doing this in the manual mode - this way leads to mistakes and loosing productivity.
With xlCompare you can put your focus on the primary tasks while the xlCompare quickly merge changes in your Visual Basic Code.
Lets look into this Difference Browser:
Every line which represents modification has a checkbox. Addes lines (marked with green + sign), deleted lines (marked with red X) has checkbox near the item. Changed lines has 2 values near the Value 1 and Value 2 columns.
When you press the checkbox, this modification is applied to the another workbook. Added or deleted line appears on the corresponding place in the another file. Changed line it replaced with corresponding value.
If item in the Difference Explorer corresponds to the sub or function - it is added by a single click.
Same checkboxes are present in the VBA Code window:
They work exactly in the same way as in the Difference Browser. If you check the item - it is added to another workbook.
In the VBA Code window you can check multiple items at a time. It allows to select multiple lines of code. If you click on the one of the selected checkboxes - all of them are checked or unchecked.
If you've changed code and want to rollback the modification - just uncheck the appropriate checkbox. Removing the checkmark leads to the restoring original part of the code.
Checkmarks in the VBA Code window and in the Difference Browser are syncronized. Once you've made a merge operation it is reflected in the VBA Code window and in the Difference Explorer.
We've explained how to add code to your module. But you may need to remove part of the code from your file.
Just select the code you need in the VBA Code window and press DELETE key or use Right Click Menu | Delete command:
To undo the operation and restore code - use Undo Delete command from this menu.
Deleted code is marked with diagonal cross lines:
Note. Code is not deleted immediately. It is deleted when you save the workbook, or when you close Difference Browser. So, you can restore deleted block when needed.