+ Reply to Thread
Results 1 to 6 of 6

Find/Replace Characters in a string

  1. #1
    Registered User
    Join Date
    01-14-2010
    Location
    Portland, OR USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Find/Replace Characters in a string

    There is a string "strSearch" which contains characters "&lte;". I would like to replace "&lte;" with "≤", but for some reason it is replaced with "=". The function below works otherwise...the character code is correct. What is the problem here?

    Please Login or Register  to view this content.
    Last edited by Light Pail; 01-20-2010 at 07:12 PM.

  2. #2
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: Find/Replace Characters in a string

    Hi Light Pail,

    I used your function, and it seems to be working fine on a spreadsheet.

    If you're trying to convert a string to be used in another VBA procedure, I don't think the VBA environment accepts that character.

    I could be wrong.
    Last edited by quekbc; 01-20-2010 at 07:48 PM. Reason: thought of something else

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

    Re: Find/Replace Characters in a string

    I think the MsgBox shows only the Extended ASCII character set, not Unicode. Cells and textboxes on forms will show Unicode.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    01-14-2010
    Location
    Portland, OR USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Find/Replace Characters in a string

    I am trying to convert in the VBA environment, before the string is written to a file in a different function. In VBA, the MsgBox (ChrW(8804)) returns an "=" sign as well.

    Any resources regarding the limitations of special characters in VBA?

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

    Re: Find/Replace Characters in a string

    The string contains the correct character; MsgBox maps it to the ASCII character set. To convince yourself,

    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: Find/Replace Characters in a string

    Based on shg's comment, you can find a list of supported characters by searching through the magic F1. Search for "character set" (without the quotation marks) and you'll get a list of what's supported.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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