+ Reply to Thread
Results 1 to 11 of 11

How to Remove spaces from a cell value? Trim function not working

  1. #1
    Registered User
    Join Date
    10-12-2015
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    95

    How to Remove spaces from a cell value? Trim function not working

    I am having trouble with spaces in cell values, due to which I can't perform calculations with the values. The trim function is not working either. I'm attaching a sample file. Any Guidance will be appreciated.
    Attached Files Attached Files
    Last edited by terry3218; 04-07-2016 at 11:14 AM. Reason: wrote time instead of trim

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How to Remove spaces from a cell value? Trim function not working

    Which cell(s) have spaces you want to get rid of?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    10-12-2015
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    95

    Re: How to Remove spaces from a cell value? Trim function not working

    Amount cell (column E). Thanks for the response.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How to Remove spaces from a cell value? Trim function not working

    B4 contains ASCII code 160 (which appears as a blank space). If you have a regular keypad keyboard, You can Find/Replace (CNTRL H) Find what: ALT + 160 (on keypad), Replace with: leave blank

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How to Remove spaces from a cell value? Trim function not working

    See post 4, Replace All

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How to Remove spaces from a cell value? Trim function not working

    If you do not have a keypad, you can copy it (a blank space) from the spreadsheet and paste it into the FIND/Replace Window

  7. #7
    Registered User
    Join Date
    10-12-2015
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    95

    Re: How to Remove spaces from a cell value? Trim function not working

    Wow!!! Thanks! Works like a magic. You saved me from hours of manual calculations, thanks again!

  8. #8
    Registered User
    Join Date
    10-12-2015
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    95

    Re: How to Remove spaces from a cell value? Trim function not working

    Adding to your reputation!

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to Remove spaces from a cell value? Trim function not working

    The macro at this website will remove all leading/trailing
    and multiple interspersed char 32 space characters.
    It will also remove and/or convert char 160 non breaking
    spaces into standard char 32 space characters. It will
    work on text or numbers and the numbers will be
    converted to true numeric numbers.

    I use this macro dozens of times every single day!
    It's a real time saver.

    http://www.mvps.org/dmcritchie/excel/join.htm#trimall
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  10. #10
    Registered User
    Join Date
    10-12-2015
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    95

    Re: How to Remove spaces from a cell value? Trim function not working

    Tony Valko, thanks a million for your input. I will surely try this macro.

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to Remove spaces from a cell value? Trim function not working

    You're welcome!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Remove Spaces, Trim?
    By cybercab in forum Excel General
    Replies: 3
    Last Post: 02-11-2023, 02:39 PM
  2. [SOLVED] Trim function must remove all spaces between words.
    By HerryMarkowitz in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-16-2016, 10:04 AM
  3. [SOLVED] trim does not remove leading spaces?
    By inventorgeorge in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 11-28-2015, 01:19 PM
  4. TRIM function and leading spaces
    By nsv in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 10-01-2014, 10:32 PM
  5. [SOLVED] Trim spaces before and after string in cell
    By xbr088 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-03-2013, 01:09 PM
  6. TRIM spaces in between word in one cell
    By JohnSeito in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-28-2008, 09:05 PM
  7. Trying to trim a trailing space char and the Trim function isn't working
    By Psychochook in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-30-2007, 11:28 PM

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