Removing indentation in Excel is necessary when you have to deal with a lot of misaligned lines. You may need to remove all the misaligned lines quickly to maintain a clean layout, enhance printing output, and promote readability.
In this Excel tutorial, you will learn how to remove an indent in Excel with several Excel features and VBA code.
Consider a sample dataset of some bestselling books along with their prices. All the texts are indented, and the removal of indentation is required. So, we have removed the indentation using Excel features.
There are 3 ways to remove an indent in Excel:
1. Using Decrease Indent Command
You can remove the indent in Excel with the Decrease Indent command. The command is located in the Alignment group of the Home tab. The Decrease Indent command will decrease the indent, which is equivalent to three times the space for clicking each time.
To decrease indent in Excel, follow the steps:
- Select the data where you want to decrease the indent.
Here, we have selected the B6:B10 range. - Then, click as follows to increase the indent: Home tab > Alignment group > Decrease Indent command.
Or, press ALT + H + 5 keys to decrease the indent in Excel.
As a result, the indentation has been decreased to the left side.
Note: Often, users add extra space before text for indenting texts. Therefore, the Decrease Indent command is unable to remove the indent. So, deleting the blank spaces helps.
2. Using Format Cells Dialog Box
The use of the Format Cells dialog box can be another way to remove the indent in Excel. Suppose you need to decrease the indentation multiple times to keep the left alignment altogether. In this case, the best way is to use the Format Cells dialog box. So, you will be able to insert the indent number and decrease the indent directly. Here’s how:
- Select your data.
Here, we have selected the B6:B10 range. - Click sequentially: Home tab > Alignment Settings icon.
Or, open the Format Cells dialog box by pressing Ctrl + 1 keys.
- So, the Format Cells dialog box appears.
- You will figure out the Alignment tab.
- Insert 0 in the Indent field since we want the previous left alignment.
- Then press OK.
Therefore, there will be no indentation.
3. Applying VBA Macro
To want the indent in Excel, you can also use the VBA Macro. By using VBA, you can easily select the required range and remove the indent automatically. VBA Macro is also useful for removing indents in multiple worksheets and workbooks.
To remove the indent using VBA, follow the steps:
- First, go to the Developer tab > Visual Basic command.
- A Microsoft Visual Basic for Application dialog box appears.
- To insert a module, click as follows: Insert tab > Module command.
- Now, copy the following codes:
Sub Remove_Indent() 'Developed by MD Tanvir Rahman, ExcelDemy Dim rng As Range Set rng = Application.InputBox("Select a range:", Type:=8) rng.IndentLevel = 0 End Sub
- Click on the Run command.
- An Input dialog box will appear. So, select the range to remove the indentation.
Here, we select the B6:B10 range.
In the following GIF, you can see that indentations have been successfully removed before the text.
Download Practice Workbook
Download this practice workbook to exercise while you are reading this article.
Conclusion
In short, we explained how to remove indent in Excel. You can use the Decrease Indent commands as well as keyboard shortcuts to remove indent. To get rid of pressing the Decrease Indent command multiple times, you can use the Formats Cells dialog box. The application of VBA Macro can be an excellent decision when dealing with multiple datasets and worksheets.
Please feel free to share your opinions, thoughts, suggestions, and queries in the comment section below.
Frequently Asked Questions
How to increase indent in Excel?
To increase indent in Excel, select your data and click as follows:
Home tab > Alignment group > Decrease Indent command.
What if the Decrease Indent command is grayed out?
The Decrease Indent command is greyed out when you select a particular string of an Excel cell or the cell is locked.
Also, if there are blank spaces before texts, the Decrease command doesn’t work.
Can I remove indent from a cell using Excel formula or function?
No, the removal of indentation from a cell cannot be achieved using formulas or functions. Indentation is a formatting feature and needs to be adjusted through the cell formatting options.
Related Articles
- How to Indent Second Line in Excel Cell
- How to Indent Twice the Data in Excel
- How to Indent Bullet Points of a Cell in Excel
<< Go Back to Indentation in Excel | Excel Cell Format | Learn Excel