+ Reply to Thread
Results 1 to 7 of 7

Delete all special characters in a selected column

  1. #1
    Registered User
    Join Date
    05-30-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    23

    Delete all special characters in a selected column

    Hi, Is there a way to delete all special characters except "-" and "space" in excel. Currently, I am doing a search and replace for any special characters I see.

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Delete all special characters in a selected column

    Have you looked into the CLEAN function?

  3. #3
    Registered User
    Join Date
    05-30-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Delete all special characters in a selected column

    yes, I tried =CLEAN(Cell). I didn't find anything changed. I can still see all the special characters. Searching about it, it can only delete un printable characters.

  4. #4
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Delete all special characters in a selected column

    So you want to delete all characters except:

    Alphabetic characters (A-Z,a-z)
    Numbers (0-9)
    Spaces
    Hyphens

    Is that correct?

  5. #5
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Delete all special characters in a selected column

    If my previous assumptions are correct then this code should work. Select the cells you want to 'clean' and run the macro.

    This will overwrite the existing data, so please make a backup before running.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    05-30-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Delete all special characters in a selected column

    Wonderful. Exactly what I needed. Thanks very much for the help.

  7. #7
    Registered User
    Join Date
    05-30-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Delete all special characters in a selected column

    Hi Andrew, I am having a problem with the script. When I select a column, it is processing all the rows in excel in that column even though they are empty. This is taking a long time and some times ending with errors. Is it possible to just parse till the last row?

+ 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