3 Easy Ways to Remove Indent in Excel

Get FREE Advanced Excel Exercises with Solutions!

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.

Remove indent in Excel

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:

  1. Select the data where you want to decrease the indent.
    Here, we have selected the B6:B10 range.
  2. 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.
    Using Decrease Indent command to remove indent in ExcelAs a result, the indentation has been decreased to the left side.
    Removed Indent in Excel

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.
Removal of Indentation not working


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:

  1. Select your data.
    Here, we have selected the B6:B10 range.
  2. Click sequentially: Home tab > Alignment Settings icon.
    Or, open the Format Cells dialog box by pressing Ctrl + 1 keys.
    Selecting Alignment Settings icon
  3. 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.

    Removing Indent with Format Cells dialog boxTherefore, there will be no indentation.
    Removed Indent with Format Cells dialog box


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:

  1. First, go to the Developer tab > Visual Basic command.
  2. A Microsoft Visual Basic for Application dialog box appears.
  3. To insert a module, click as follows: Insert tab > Module command.
  4. 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
  5. Click on the Run command.
  6. 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.
    Removing Indent with Excel VBA Macro

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


<< Go Back to Indentation in Excel | Excel Cell Format | Learn Excel

What is ExcelDemy?

ExcelDemy - Learn Excel & Get Excel Solutions Center provides online Excel training , Excel consultancy services , free Excel tutorials, free support , and free Excel Templates for Excel professionals and businesses. Feel free to contact us with your Excel problems.
MD Tanvir Rahman
MD Tanvir Rahman

MD Tanvir Rahman, BUET graduate in Naval Architecture and Marine Engineering, dedicated over a year to the ExcelDemy project. He is an Excel and VBA Content Developer. Having authored 50+ insightful articles, he actively updates and improves over 80 articles, reflecting his commitment to accuracy and currency, managing day-to-day operations, and analyzing and developing Excel and VBA tutorials. His broad interests encompass Data Analysis, Advanced Excel, VBA Macro, Excel Templates, Excel Automation, and Excel Power Query, showcasing a... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo