Add and Remove Indent in Excel

HomeExcel BasicsAdd and Remove Indent in Excel

In Excel, there are multiple ways to increase and decrease indent and, in this tutorial, we are going to learn all these methods.

Indent Buttons from the Ribbon

There are two buttons that you can use to add or remove indent from a cell or range of cells. The button that has the right arrow is for adding the indent and to pretend that has a left arrow is for removing the intent.

indent-buttons-from-ribbon
  1. First, you need to select the cell or range of cells where you have added or remove the indent.
  2. After that, go to the home tab locate the alignment tab there.
  3. From here, in the alignment tab, there are two buttons that you can use.
  4. In the end, click on the button to add or remove the indent.

As you can see in the following example, we have added one indent in cell A1.

add-or-remove-the-indent

And you want to add more than one indent, you need to click the button that number of times. That means if you want to add indent three times, we need to click the button three times. And removing an indent goes the same way.

Keyboard Shortcut for Adding Indent

You can also use a keyboard shortcut to add – remove an indent from the cell. There are two different shortcuts for adding a removing indent.

  • Increase Indent: Alt ➜ H ➜ 6
  • Decrease Indent: Alt ➜ H ➜ 5

Related: Keyboard Shortcuts (PDF Cheat Sheet)

VBA Code to Add Indent

If you understand VBA, you can write a code that can add indent to the selected cell, just like the following code.

Sub Macro1()
Dim myInt As Integer
myInt = InputBox("how many indents you want to add?", "Add Indent")
Selection.InsertIndent myInt
End Sub

Before you run this code, you need to select the cells where you want to increase the indent. It will show you an input box to enter the number indent you want to add.

vba-to-add-indent

Removing Indentation from a Cell

As we have discussed at the beginning of this tutorial you can use the decrease indent button to remove the indentation from a cell.

removing-indentation-from-cell

Apart from this, you can clear formatting from a cell or range of cells to remove indentation as it’s part of the cell formatting.

clear-formatting