Smart Indenter Version 3.5 (released 10th February 2005) is available free for Office 2000/2002/2003, Visual Basic 6 and Excel 97

The Smart Indenter is a utility to tidy up VBA code by rebuilding the indentation of each line. Most developers naturally indent code within control structures, such as For...Next, If...End If, etc. Many developers also indent all the code within a procedure, to ease identification of line labels, error handling blocks etc. From that point on, there is much more variety in indenting styles, ranging from how to treat declaration lines to handling end-of-line comments.

The latest version of the Smart Indenter includes the options shown below:

As the options are changed, the example procedure is re-indented to show the effect of the option and to give an indication of how your code will look after the indenting is complete.  Many of these options have been suggested by users of previous versions of the Smart Indenter program.  If there are other options that you'd like to see included in future versions of the program, please email Note that the Excel 97 version does not include the Hot-key indenting options.

The indenting algorithm should correctly handle all possible valid VBA code, including multi-statement lines, continued lines and line numbering.  If you find any VB or VBA code that compiles without error but is indented incorrectly, please email the code snippet.

The Smart Indenter is integrated into the Office 2000/2002/2003 VBE and Visual Basic 6 IDE and is accessed through menu items added to the Edit, Code Window and Project Explorer pop-up menus, or by user-defined hot-key combinations.  The routine can rebuild the indenting for the current procedure, current module or entire project in one pass, with full Undo available (if enabled in the Options dialog).  When undoing, the routine will not modify any lines that have been changed since the indenting was performed.


Version 3.5 of the Smart Indenter is available for Office 2000/2002/2003, Visual Basic 6 and Excel 97. The version for Office 2000/2002/2003 is an add-in for the VBA IDE, so works with all the Office applications and all other VBA6 hosts (such as AutoCad).

Versions are available for the following applications:


Version Available


Version 3.5 contains fixes for the following issues:

Contact and Support

If you have any questions about any of the utilities or example files found on this site, please contact us:

By post:    Office Automation Ltd.
40 The Charter Road
Woodford Green
London  IG8 9RE

Last Updated 10th February 2005

Microsoft and the Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries