+ Reply to Thread
Results 1 to 9 of 9

Removing spaces

  1. #1
    Forum Contributor
    Join Date
    11-13-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    279

    Removing spaces

    I understand the TRIM function in excel removes spaces from the end and beginning of strings, but is there some way to change the settings of a workbook so that this is done to every cell, I have an entire data book with filthy spaces at the end of texts and its in such a dotted about manner that trimming everything would be gloriously impractical,

    I expect no is the answer unfortunately, but thanks all the same

  2. #2
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Removing spaces

    You can't do it in Excel settings because it might not be applicable to every workbook you use.. Trim is one a multitude of functions so applying it to individual workbook settings becomes impractical. It's usually good practice to use every scrap of information available but then restrict the "Users" view to what looks pretty.
    Last edited by AndyLitch; 07-05-2013 at 04:59 AM.
    Elegant Simplicity............. Not Always

  3. #3
    Registered User
    Join Date
    05-21-2012
    Location
    Coimbatore, India
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Removing spaces

    Select the whole worksheet, CTRL + F (Find) space (space bar) and replace with none.

  4. #4
    Registered User
    Join Date
    10-30-2012
    Location
    Modlin , Poland
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    42

    Re: Removing spaces

    you can try this:
    select column you want to change
    ctrl+h and there you can type what you want to change and what you want instead
    the only problem is that this remove all the spaces in each cell, not sure if you want this

  5. #5
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Removing spaces

    Replace ALL will take out the spaces between words which will read like a bag of spanners

  6. #6
    Forum Contributor
    Join Date
    06-26-2013
    Location
    LAX
    MS-Off Ver
    Excel 2007,Excel 2010
    Posts
    363

    Re: Removing spaces

    Hi David,

    Try and see if this works.

    Assume your data is in "spaced_data" tab. Create a empty work sheet, name as "trim_data". In "trim_data"sheet, in cell "a1" type

    =trim(spaced_data!a1) and drag for cell range as much as the range you have values in the "spaced_data".

    Now copy all the cells in "trim_data" tab and paste as values in the "trim_data" sheet itself or in a new sheet. Now, You should have "all end space" removed data.

    Hope this works..
    Attached Files Attached Files

  7. #7
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Removing spaces

    Use a simple macro
    Please Login or Register  to view this content.
    Note that VBa TRIM() is different from Excel TRIM()

    VBa TRIM() will remove only leading and trailing spaces, Chr(32)
    Excel TRIM() removes all extra spaces
    Last edited by Marcol; 07-05-2013 at 06:08 AM. Reason: Added comment to code
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  8. #8
    Forum Contributor
    Join Date
    11-13-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    279

    Re: Removing spaces

    thank you very muchos

  9. #9
    Registered User
    Join Date
    03-14-2012
    Location
    KERALA
    MS-Off Ver
    EXCEL 2007
    Posts
    18

    Re: Removing spaces

    you can use trim

+ 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