Strip Chinese Characters from a string (vba)

后端 未结 2 1598
别那么骄傲
别那么骄傲 2021-01-03 17:01

I am using Microsoft Project VBA to translate my activity names from English to Chinese.

My problem is I have some Chinese translations embedded in some of the Engl

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-03 17:53

    You have to use ChrW$() as this:

    MyString = "This is my string with a " & ChrW$(&H6C49) & " in it."
    

    The H6C49 is available (thanks God for that) on Unicode as CJK codes (Chinese, Japanese and Korean). See this to take a look of the characters range.

    So, you have to check the character Unicode code and then compare if it is already on the CJK range so as to translate it or not.

    There is also a good explanation and even a program to translate strings here

提交回复
热议问题