+ Reply to Thread
Results 1 to 11 of 11

Unwanted Spaces (I think)

  1. #1
    Registered User
    Join Date
    03-21-2017
    Location
    PA
    MS-Off Ver
    2016
    Posts
    12

    Unwanted Spaces (I think)

    Please see the attached file. Simple copy/paste of names into Column A and then text-to-columns to Column B&C; Finally combining names in Column D. After the last name, there is unwanted spaces (I can only assume that's what it is). I've tried TRIM with no luck; F5, Special, Blanks and no luck; Find and Replace with no luck. I cannot get rid of these gaps. Any suggestions? Thanks.
    Attached Files Attached Files

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Unwanted Spaces (I think)

    They are non-breaking spaces, CHAR(160).

    To remove, do find and replace. In the Find box, press and hold the Alt key, then press 0160 on the NUMERIC keypad. Leave the Replace box blank, press Replace All.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Unwanted Spaces (I think)

    try replace char(160) with ""

  4. #4
    Registered User
    Join Date
    03-21-2017
    Location
    PA
    MS-Off Ver
    2016
    Posts
    12

    Re: Unwanted Spaces (I think)

    Was able to get "shg" to work but not "sandy666." For future, how can I tell an Excel CHAR code/function? Thanks.

  5. #5
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Unwanted Spaces (I think)

    =TRIM(SUBSTITUTE(A2,CHAR(160),"")) then text2column

  6. #6
    Registered User
    Join Date
    03-21-2017
    Location
    PA
    MS-Off Ver
    2016
    Posts
    12

    Re: Unwanted Spaces (I think)

    Works perfectly. Missed Substitute. Thanks. Lastly though, how could you tell CHAR was my initial obstacle?

  7. #7
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Unwanted Spaces (I think)

    excess spaces [TRIM() ], non-printable characters [CLEAN() ], and CHAR(160)
    together: =CLEAN(TRIM(SUBSTITUTE(A2,CHAR(160),"")))
    popular problem

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,531

    Re: Unwanted Spaces (I think)

    Lastly though, how could you tell CHAR was my initial obstacle?
    It's a common problem when data comes from external applications, particularly data downloaded from the Internet.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Unwanted Spaces (I think)

    Quote Originally Posted by excelnovice19 View Post
    how could you tell CHAR was my initial obstacle?
    I use an add-in form. See https://app.box.com/s/gfo2l90kenhcnj3vjjx1bi0qpy6m85g7; it includes a ReadMe with instructions to install.

  10. #10
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Unwanted Spaces (I think)

    If the basic problem is solved
    - it's always a good practice to show respect to the person(s) who have helped you
    - is a click on the Add Reputation first (left lower corner of the post of person(s) who helped you) and then
    - mark the thread as SOLVED (top right corner over your first post - Thread Tools). This is important for all of us,

    Thanks

  11. #11
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,427

    Re: Unwanted Spaces (I think)

    Quote Originally Posted by excelnovice19 View Post
    ... Lastly though, how could you tell CHAR was my initial obstacle ...
    You can put this formula in E2:

    =CODE(RIGHT(C2))

    then copy down. You can see that all the names in column C end with the character 160.

    Hope this helps.

    Pete

+ 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. [SOLVED] remove spaces & unwanted things
    By gondal in forum Excel Formulas & Functions
    Replies: 25
    Last Post: 06-01-2016, 09:05 AM
  2. [SOLVED] remove spaces & unwanted things
    By gondal in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-26-2015, 04:39 AM
  3. [SOLVED] Macro to clean up extra unwanted spaces
    By makinmomb in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-02-2014, 06:08 AM
  4. Need help removing unwanted spaces in columns
    By stvbrown2184 in forum Excel General
    Replies: 10
    Last Post: 06-08-2013, 08:52 PM
  5. Deleting unwanted spaces
    By Hook in forum Excel General
    Replies: 2
    Last Post: 12-15-2011, 04:08 PM
  6. Text string with unwanted spaces
    By bigskyhy in forum Excel General
    Replies: 2
    Last Post: 11-13-2008, 08:57 PM
  7. Deleting unwanted spaces
    By borchesz121 in forum Excel General
    Replies: 2
    Last Post: 04-20-2005, 09:49 AM

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