Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
FCC FCC is offline
external usenet poster
 
Posts: 1
Default VBA and Displaying Chinese


Hello,

I am currently developing some VBA code for a chinese company. I would
like to display some chinese onto the Excel worksheets through VBA.

If I type chinese directly onto the excel worksheets I have no problem
displaying them, but when I try to display them through VBA code all I
get is ??

For example,

Range("A1") = "你好"

Would just make Cell A1 display as ??

Is there anyway I can make VBA display the chinese text properly?


--
FCC
------------------------------------------------------------------------
FCC's Profile: http://www.excelforum.com/member.php...o&userid=35888
View this thread: http://www.excelforum.com/showthread...hreadid=556805

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default VBA and Displaying Chinese

Range("A1").Value = ChrW(20320) & ChrW(22909)

NickHK

"FCC" wrote in message
...

Hello,

I am currently developing some VBA code for a chinese company. I would
like to display some chinese onto the Excel worksheets through VBA.

If I type chinese directly onto the excel worksheets I have no problem
displaying them, but when I try to display them through VBA code all I
get is ??

For example,

Range("A1") = "你好"

Would just make Cell A1 display as ??

Is there anyway I can make VBA display the chinese text properly?


--
FCC
------------------------------------------------------------------------
FCC's Profile:

http://www.excelforum.com/member.php...o&userid=35888
View this thread: http://www.excelforum.com/showthread...hreadid=556805



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA and Displaying Chinese


How did the numbers 20320 and 22909 represented those characters? Is
there some kind of character list?


--
FCC
------------------------------------------------------------------------
FCC's Profile: http://www.excelforum.com/member.php...o&userid=35888
View this thread: http://www.excelforum.com/showthread...hreadid=556805

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default VBA and Displaying Chinese

You provided those character codes, so I don't know where you got them from.
However, you use the Character Map (which is AFAIK available on all systems)
to see the Hex codes for characters in various fonts/character sets.
You also have the VBA function ChrW and ASCW.
It depends somewhat on where your Chinese characters are coming from and
what you are doing with them.

NickHK


"FCC" wrote in message
...

How did the numbers 20320 and 22909 represented those characters? Is
there some kind of character list?


--
FCC
------------------------------------------------------------------------
FCC's Profile:

http://www.excelforum.com/member.php...o&userid=35888
View this thread: http://www.excelforum.com/showthread...hreadid=556805



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA and Displaying Chinese


Opps, I actually typed by response incorrectly. I meant to say

How did you know the numbers 20320 and 22909 represented those
characters?

But in any case, I found the character Map on my operating system (XP
Home), but I am unable to display the hex let alone even search for the
characters I want.

I chose the character set Unicode and chose the font PMingLiU (which is
by default available as a font for all windows machines) and then I
tried to search for words and nothing happened.

Can you explain how you were able to find the hexcodes?

Thanks


--
FCC
------------------------------------------------------------------------
FCC's Profile: http://www.excelforum.com/member.php...o&userid=35888
View this thread: http://www.excelforum.com/showthread...hreadid=556805



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default VBA and Displaying Chinese

The Hex code is shown in the bottom left hand corner.
But if know the text you need to use, you can paste it into Excel, then
CharCode=AscW(Mid(Range("A1").Value,i,1), where i =1,2 or whatever.

But if have the text, can you not just it in Excel and forget about the VBA
side ?

NickHK

"FCC" wrote in message
...

Opps, I actually typed by response incorrectly. I meant to say

How did you know the numbers 20320 and 22909 represented those
characters?

But in any case, I found the character Map on my operating system (XP
Home), but I am unable to display the hex let alone even search for the
characters I want.

I chose the character set Unicode and chose the font PMingLiU (which is
by default available as a font for all windows machines) and then I
tried to search for words and nothing happened.

Can you explain how you were able to find the hexcodes?

Thanks


--
FCC
------------------------------------------------------------------------
FCC's Profile:

http://www.excelforum.com/member.php...o&userid=35888
View this thread: http://www.excelforum.com/showthread...hreadid=556805



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 traditional chinese to simplified chinese SHO Excel Discussion (Misc queries) 0 December 1st 06 05:23 AM
Chinese in VBA tjmj Excel Programming 0 June 17th 06 01:12 PM
numbers in chinese Deeps Excel Programming 1 April 11th 05 03:29 AM
Chinese Bill[_28_] Excel Programming 3 January 25th 05 03:23 PM


All times are GMT +1. The time now is 11:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"