welcome to my space
    TRIM in Excel Best answer on the web
    Filed under: tarareidtopless.com
  • Im trying to use excel to remove a leading space from a cell, however
    TRIM(A1) function is not working to remove the space. In addition, I
    get a ?NAME error if I try to use LTRIM. Anyone know how to solve
    this?


  • I suspect that the reason TRIM isn't working is because the leading space is a hard space - char(160) rather than a regular space, char(32). The simplest way to solve this is to highlight the leading character from the formula bar and copy it to the clipboard using ctrl-c. Then, go to replace in the edit menu and paste the character using ctrl-v into the "search for" box. In the "replace with" box, just hit the space bar once. Click on replace all. You could just leave the "replace with" box empty, but there's a danger that it would replace legitimate spaces with nothing, removing the spaces. When you have replaced all the hard spaces, TRIM should work properly.


  • Yup, what joet31124-ga says will work fine.


  • ms2005-ga,

    TRIM(A1) is working fine for me. Could you describe what you mean by not working? What did you type in A1? What does TRIM(A1) return?
    - Hammer


  • Hammer- see this-
    Music
     music
     music download
     free music downloads
     music video

    See how those have leading spaces in front of them? Pretend that was column "A". In column "B" I set a function "=TRIM(A1)" then on the next line "=TRIM(A2)" etc. But it will not get the space out for me. Can you tell me the exact steps to make TRIM work? Maybe I need to have something highlighted or??? Thanks.


  • So, if it says in A1
    music

    ... When you put the following formula in B1:
    =TRIM(A1)

    ... B1 displays
    music

    ... instead of
    music

    Is this correct, or are you seeing something else?

    - Hammer


  • -Hammer-

    That is how it should work- and yet it is not removing the leading space for me. My formulas etc look to be correct. It might be having something selected differently etc? Any additional thoughts?









  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about TRIM in Excel , Please add it free.
    jack @ July 28, 2010 edit