How to handle unicode characters in VB code?

B

Bjorn Elfvin

I need to concernate a string variable in excel containing some arrow
characters. They are unicode #2191 to 2193.
In the vba editor they appear as a "?" character in the string.

Dim x as String
x = ChrW(2191)
result in a x = "?"

Is the vba enviroment unicode compatible?
 
M

Michael Herzfeld

The Visual Basic Editor is a non-Unicode app, so this behavior is
expected. For the record, I think you might be using the wrong value in
your call to ChrW. I believe 2191 is the hex value for the arrow you're
using. So your call to ChrW should either be ChrW(&h2191), or you can
convert to decimal and use ChrW(8593).

Michael Herzfeld
Office Programmability Test Team


-----Original Message-----
From: Bjorn Elfvin [mailto:[email protected].(donotspam)]
Posted At: Thursday, September 01, 2005 4:20 AM
Posted To: microsoft.public.office.developer.vba
Conversation: How to handle unicode characters in VB code?
Subject: How to handle unicode characters in VB code?

I need to concernate a string variable in excel containing some arrow
characters. They are unicode #2191 to 2193.
In the vba editor they appear as a "?" character in the string.

Dim x as String
x = ChrW(2191)
result in a x = "?"


Is the vba enviroment unicode compatible?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top