How to remove leading and trailing spaces in Excel 2007/2010?

This article provides ways to unhide the hidden worksheets in Excel 2007/2010 step by step.

Kutools for Excel: 120 Cool Tools and Advanced Features for Excel 2013, 2010 and 2007. Read more...
Office Tab: Enable Tabbed Editing and Browsing in Office, Just Like Chrome, Firefox, IE 8/9/10. Read more...
Classic Menu for Office: Bring Classic Menus and Toolbars of Office 2003/XP/2000 Back to Office 2007, 2010 and 2013. Read more...

Method A: using Trim function in Excel to remove leading and trailing spaces

Hot
Amazing! Using Tabs in Excel like Firefox, Chrome, Internet Explore 10!

Learn more Free download

The syntax for the TRIM function is:

= TRIM ( Text )

Like the following example shows, to remove the space in the cell C11, just click a new cell and enter the trim formula to apply the modification. See screenshot (Fig. 1).

doc-remove-trailing-space-trim-excel

Fig.1 trim function in Excel

Note: The TRIM function will not remove all space characters. In particular one commonly used space character that TRIM will not remove is the non-breaking space used in web pages.


Method B: a fast way to remove all the leading and trailing spaces in Excel

The third party add-in Kutools for Excel can help remove all the leading and trailing spaces quickly in Excel.

Kutools for Excel: with more than 60 handy Excel add-ins, free to try with no limitation in 30days. Get it Now.

Compare with the trim function in Excel, the Removing spaces utility in Kutools for Excel provides more flexible way to remove all the excessive space in Excel. You can directly remove the space in the cell without moving them into other cells. More important, you can remove other kind of space in the cell, such as all excess space, all space and so on.

Step 1: Select the cells that you want to modify. You can select some columns, rows or the entire worksheet.

Step 2: Click Kutools > Text Tools > Remove Spaces > Leading and Trailing SpacesSee screenshot (Fig. 2).

Step 3: Click OK to apply it.

doc-remove-trailing-space1-kte

arrow-big-down

doc-remove-trailing-space2-kte

Fig.2 Remove spaces in Kutools for Excel

Kutools for Excel

More than 120 Advanced Functions for Excel 2013, 2010, 2007 and Office 365.

screen shot

btn read more     btn download     btn purchase