How to Remove the Tab Space from Excel – 5 Methods

The following dataset has 5 comments. There are unnecessary tab spaces.

 


Method 1 – Use the Excel CLEAN Function to Remove the Tab Space

Steps:

  • Add a new column (Cleaned Data).

  • Go to C4 and enter the following formula.

=CLEAN(B4)

Excel CLEAN Function to Remove Tab Space

  • Drag down the Fill Handle.

Excel CLEAN Function to Remove Tab Space

Comments will be displayed without spaces.

Read More: How to Remove Space between Rows in Excel


Method 2 – Using the TRIM Function to Remove the Tab Space

The TRIM function removes all spaces from a text string except for single spaces between words.

The SUBSTITUTE function replaces existing text with a new text to a text string.

The CHAR function returns the character specified by the code number from the character set for your computer.

Steps:

  • Go to C4. Enter the following formula.

=TRIM((SUBSTITUTE(B4,CHAR(9)," ")))

TRIM Function to Remove Tab Space

  • Double click the Fill Handle.

This is the output.

Read More: How to Remove Space in Excel after Text


Method 3 – Using the Find and Replace Feature to Remove the Tab Space

Steps:

  • Select all cells in the Comments column.
  • In Editing, choose Find & Select. Click Replace.

Find and Replace Feature to Remove Tab Space

You can also press Ctrl+H.

  • In Find and Replace:

  • Go to Find what and enter Alt+ 0010.

Note:

Your keyboard must have a separate number pad to type 0010 after the ALT key.

  • Go to  Replace with and enter spacebar.
  • Click Replace All.

Find and Replace Feature to Remove Tab Space

This is the output.

 

Read More: How to Remove Blank Spaces in Excel


Method 4 – Removing Tab Spaces Between Words with VBA

Steps:

  • Go to  Sheet Name.
  • Choose View Code.

Removing Tab Spaces Between Words with Excel VBA

  • In the Insert tab, choose Module.

Removing Tab Spaces Between Words with Excel VBA

  • Enter the VBA code.

 

Sub RemoveTabSpace()
    Selection.Replace Chr$(9), vbNullString
End Sub
  • Select the cells in the Cleaned Data column.
  • In the VBA window, press F5 to run the code.

Removing Tab Spaces Between Words with Excel VBA

This is the output.

All unnecessary spaces were removed.


Method 5 – Removing Extra Spaces with the Power Query

Steps:

  • Select all cells in the Comments column.
  • Go to the Data tab and choose From Table/Range.

Remove Extra Tab Spaces with Excel Power Query

  • Check My table has headers.
  • Click OK.

Remove Extra Tab Spaces with Excel Power Query

The Power Query window will open.

  • Go to the column heading.
  • Right-click.
  • Choose Transform.
  • Click Clean.

Remove Extra Tab Spaces with Excel Power Query

This is the output.

 

Read More: How to Remove Space after Number in Excel


Download Practice Workbook

Download this practice workbook to exercise.


Related Articles

<< Go Back To Remove Space in Excel | Data Cleaning in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!

Leave a Reply

Your email address will not be published. Required fields are marked *

Advanced Excel Exercises with Solutions PDF