Edit - Indent

Ribbon bar. Select the Macro tab. In the Tab group, click Indent to indent (shift to the right) the highlighted code in the macro window.

Classic menus. From the Edit menu, select Indent to indent (shift to the right) the highlighted code in the macro window.

Indenting is useful for formatting blocks of code to make it more readable. Consider the following example:

This For loop is rather difficult to read:

For i = 1 To ActiveSpreadsheet.NumberOfCases
 'add all the cases to marked, remove any
 'special formatting, and adjust its height
 ActiveSpreadsheet.Case(i).AddToMarked
 ActiveSpreadsheet.Case(i).ClearFormats
 ActiveSpreadsheet.Case(i).AutoFit
 Next i

Indenting the code within the loop better defines the instructions that are being executed in the loop:

For i = 1 To ActiveSpreadsheet.NumberOfCases

'add all the cases to marked, remove any
 'special formatting, and adjust its height
 ActiveSpreadsheet.Case(i).AddToMarked
 ActiveSpreadsheet.Case(i).ClearFormats
 ActiveSpreadsheet.Case(i).AutoFit

Next i

Note: indenting will not have any effect on the execution of your macro; it is merely a cosmetic feature. See also Edit - Outdent.