Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Documenting Changes in VBA Code.
by Allen Wyatt
(last updated June 18, 2018)
Phil is a member of his bank's MIS department. The department creates a lot of management reports using Excel. In doing so they write a lot of macros to automate the reports as much as possible. Because of the Sarbanes-Oxley act the bank is required to track changes to the VBA code. Phil wonders if there are any products or methods to track the changes in the VBA code that would highlight what was changed and then preserve those changes for documentation purposes.
The easiest way to do this would be to periodically export the macro code to a text file, and then archive the text files. This could be done every day, week, month, etc., or it could be done anytime there is a change in the code. Simply give each text file a different descriptive name so you can tell which version the file contains.
Once in text-file format, the files can be easily compared against one another to highlight differences; there are any number of commercial products that could be used for comparing the text files. (You could even use Microsoft Word to compare different versions of files.)
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (3808) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Documenting Changes in VBA Code.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
Even if you do nothing but record macros, sooner or later you will have a need to edit what you record. Here's how to get ...Discover More
One of the most basic of programming structures is the conditional structure: If ... End If. This tip explains how this ...Discover More
If you have a macro that takes a long time to process a workbook, you might want to continue working in Excel while the ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.