top of page
  • John

Automatically indenting VBA code

Indenting code ... it's not sexy ... but it does make code much more readable and maintainable when done correctly. So let VBE_Extras take the strain and use its 'Indent' function to do it for you. The Indent function can run on 3 different scopes:


  • Indent a single Procedure / Property

  • Indent an entire Module (including / excluding the Module declaration lines)

  • Indent an entire Project


The Indent function correctly handles line numbers and line labels if present in the code being indented.


It also preserves Attributes if present in the code being indented.


You can customise how the Indent function works such as your preferred size of indent (in characters), whether to indent within conditional compilation blocks and within On Error blocks and, other options, in the Settings dialog of VBE_Extras.


Here's an example - VBE_Extras will convert this ...



... to this ...



... with a single click.

0 comments
bottom of page