+ Reply to Thread
Results 1 to 3 of 3

Help to create a macro - Find special characters and replace

  1. #1
    Registered User
    Join Date
    11-17-2016
    Location
    United States
    MS-Off Ver
    2010
    Posts
    9

    Help to create a macro - Find special characters and replace

    So im trying to create a macro that finds all characters that are not letters, numbers or dashes - and replacing them with a space. i'm trying and failing

    so if in a cell it had. - > Jim(04)"$42" it would replace everything with - >Jim 04 42 there would be a space at the end as well

    So it would essentially look for any and all special characters !@#$%&^*)( including ones from older versions of excel (im assuming thats what they are from). like there are different type of quotes and different types of spaces to I've noticed in my files from other companies. that find and replace cant find.

    This part i know how to do and wont need any help with:
    i would also need to add in, =Lower =trim and =clean into the macro and the Searching and replacing double spaces with just 1 space (about 3 or 4 times) and then replace the spaces with dashes so it would be like jim-04-42 i can do that part but if anyone knows how to create

    IF ANYONE CAN HELP ME OUT I WILL VERY THANKFUL!

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,159

    Re: Help to create a macro - Find special characters and replace

    Please Login or Register  to view this content.
    https://stackoverflow.com/questions/...ters-vba-excel
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,516

    Re: Help to create a macro - Find special characters and replace

    Another possibility maybe.
    Put all the to be deleted characters in an array like in this example.
    Please Login or Register  to view this content.

+ 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. Find & Replace all special characters with regular
    By mike_vr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-05-2017, 04:23 AM
  2. find and replace special characters
    By irfanparbatani in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-15-2015, 09:30 PM
  3. [SOLVED] Replace special characters macro not looping through cells
    By mattyfaz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-17-2015, 06:04 AM
  4. [SOLVED] Find and replace special characters (unicode)
    By joevan1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-10-2013, 06:05 AM
  5. Macro to replace European characters with non "special" English characters?
    By johanna0507 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2012, 09:13 AM
  6. Replies: 1
    Last Post: 05-25-2006, 11:29 AM
  7. [SOLVED] How do I find replace special characters?
    By zzapper in forum Excel General
    Replies: 1
    Last Post: 06-27-2005, 02:05 PM

Tags for this Thread

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