+ Reply to Thread
Results 1 to 4 of 4

Detection of chinese space character?

  1. #1
    Registered User
    Join Date
    05-08-2012
    Location
    Golden, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    77

    Detection of chinese space character?

    All,
    I received a file from a vendor. In that file was a cell that had a value like "Company Name" with what appeard to be a space between the two words.
    I tried to compare it to the value I had on another sheet. They appeared identical to the eye. The =len() function said they were the same length.
    But when I put to two values in adjacent cells, A1 and A2, the expression =A1=A2 returned FALSE.
    If I removed the two spaces from each, the expression returned TRUE.
    If I delete the space and replace it with a space from my English keyboard, it evaluates as TRUE.

    I suspect that a Chinese keyboard was used to enter the space, but do no know.

    Any ideas on how to detect this in the future?
    Any ideas how can I find out what the ASCII code in the offending space character is?

    Thanks.

  2. #2
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Detection of chinese space character?

    Try this:

    Put the offending data in a cell, say A1.

    Then, in B1 use this formula: =CODE(MID(A1,xx,1))
    where xx = the number of characters from the start of data in the cell
    for instance, if I needed to know what the character in between "Moo Dog" is
    I would use: =CODE(MID(A1,4,1))

    That will tell you what character code the offending character is. At that point you can just use the substitute function to replace that character with a space, like so:

    If your data is starts in A1 and below, then in B1, put this formula, and fill down:

    =SUBSTITUTE(A1,CHAR(yy)," ") where 'yy' is the code returned by the previous test.
    Hope it helps!

    - Moo

  3. #3
    Registered User
    Join Date
    05-08-2012
    Location
    Golden, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    77

    Re: Detection of chinese space character?

    Moo,
    The offending code is a 160 (decimal A0 hex) as opposed to the code for a space with is a 32 (decimal 20 hex).

    So can I do a special find and replace using the Find/Replace dialog and put either to decimal or Hex values in? Maybe something like %20 or something.
    These space characters are all over the data I receive, every space in fact.
    Thanks

  4. #4
    Registered User
    Join Date
    05-08-2012
    Location
    Golden, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    77

    Re: Detection of chinese space character?

    I decided to write a macro for my plugins. It is below. I do not know if the hex Ao space copied in this paste, but it did when I recorded this snippet of code.
    Before you use this please virify using the function Moo outlined above.
    I will use this on the entire worksheet when I get data in.
    Thanks and marking this Solved.
    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. Replies: 4
    Last Post: 04-24-2013, 10:57 AM
  2. [SOLVED] Insert two space after character
    By fatalcore in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-29-2012, 10:46 AM
  3. [SOLVED] Need to add space after every 4th Character
    By yus786 in forum Excel General
    Replies: 10
    Last Post: 04-04-2012, 06:08 AM
  4. How to convert a Chinese character into unicode number?
    By Richard Hsiao in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-22-2005, 09:05 AM
  5. Can I use Excel to convert Chinese character into Unicode?
    By Richard Hsiao in forum Excel General
    Replies: 0
    Last Post: 09-22-2005, 06:05 AM

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