+ Reply to Thread
Results 1 to 6 of 6

Find and replace special characters (unicode)

  1. #1
    Registered User
    Join Date
    04-02-2013
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    28

    Find and replace special characters (unicode)

    Hi there,

    I'm trying to record a macro that finds and deletes (replaces with "") all instances of a special character, namely "★", in a spreadsheet.

    When I use the find and replace function this works perfectly, but when I record it into a macro it doesn't recognise it and replaces the instance in the code with a question mark:

    Please Login or Register  to view this content.
    I'm sure this is quite simple but I can't see a similar post in the forum to refer to.

    many thanks for all your help!

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Find and replace special characters (unicode)

    I copied the star in the post to cell A1 then in B1: =CODE(A1) which resulted in 63. You should double check.

    Cells.Replace What:=Chr(63), etc
    Last edited by protonLeah; 10-09-2013 at 12:39 AM.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    04-02-2013
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: Find and replace special characters (unicode)

    Thanks for your quick response protonLeah.

    I've tried the suggested code and it deletes everything from the sheet for some reason. Am I doing something wrong?

    Thanks!

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Find and replace special characters (unicode)

    I used AscW in VB Editor to find the UNICODE value of AscW("★ ") = 9733, so ChrW(9733) will find the "★ "
    Please Login or Register  to view this content.
    Tested and worked on a small worksheet.
    Last edited by protonLeah; 10-10-2013 at 03:06 PM.

  5. #5
    Registered User
    Join Date
    04-02-2013
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: Find and replace special characters (unicode)

    That works absolutely perfectly!!

    thanks so much protonLeah

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Find and replace special characters (unicode)

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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 special unicode characters from range
    By Trentos in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-08-2012, 12:23 PM
  2. 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
  3. search and replace special characters
    By jmhultin in forum Excel General
    Replies: 2
    Last Post: 10-14-2009, 12:07 PM
  4. Replies: 1
    Last Post: 05-25-2006, 11:29 AM
  5. How do I find replace special characters?
    By zzapper in forum Excel General
    Replies: 1
    Last Post: 06-27-2005, 02:05 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