+ Reply to Thread
Results 1 to 11 of 11

Delete leading space

  1. #1
    Forum Contributor
    Join Date
    05-12-2009
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    219

    Delete leading space

    Hi all,

    I have a col. of name like
    Peter
    John
    Sami
    There are some invisible blank leading space after the name, how can I delete all of that leading spaces in excel at automatically?

    Thanks all for your help,
    VBisgreat

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Delete leading space

    it depends on what that leading space actually is....

    If you enter a formula like: =CODE(LEFT(A1)) where A1 contains a leading space, what does it return?
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor
    Join Date
    05-12-2009
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    219

    Re: Delete leading space

    65 is the output

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Delete leading space

    That is for uppercase "A" are you sure the first character is a space of some sort or are you talking about trailing spaces?

  5. #5
    Forum Contributor
    Join Date
    05-12-2009
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    219

    Re: Delete leading space

    see attached for example, click on the cell and you will see that there are spaces after each word.
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Delete leading space

    Those are trailing spaces.
    Life is like a roll of toilet paper. The closer it gets to the end, the faster it goes.
    John Wright

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Delete leading space

    Simply select the column and go to Edit|Replace

    Then enter a space in the Find What and leave the Replace With field

    Click Replace All

  8. #8
    Forum Contributor
    Join Date
    05-12-2009
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    219

    Re: Delete leading space

    That will work but if I have a compound word like dave smith, I don't want the space between dave and smith get remove.
    Last edited by VBisgreat; 04-06-2011 at 12:14 PM.

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Delete leading space

    Try using

    CTRL+H

  10. #10
    Forum Contributor
    Join Date
    05-12-2009
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    219

    Re: Delete leading space

    That will work but if I have a compound word like dave smith, I don't want the space between dave and smith get remove. This is a long list to do by hand. Thanks!!!

    VBisgreat

  11. #11
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Delete leading space

    Then in an adjacent column you would enter a formula like:

    =TRIM(A2) copied down, where A2 contains first string.

    Then you can copy this column and paste special >> Values over the original column and delete the helper.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1