Character Map Help

P

Patrick Jackman

Using Character Map, I can copy and paste a "Black Up-Pointing Triangle"
(Arial, U+25B2) into the caption of label control. How can I paste this
character in VBA?

Patrick
=-=-=-=-=-=-=-=-=-=-=-=-=-
Patrick Jackman
Vancouver, BC
 
D

Dirk Goldgar

Patrick Jackman said:
Using Character Map, I can copy and paste a "Black Up-Pointing Triangle"
(Arial, U+25B2) into the caption of label control. How can I paste this
character in VBA?


It's a double-byte character with the decimal value 9650. You have to use
the ChrW() function to represent it. For example,

Me.Label1.Caption = "This is the character: " & ChrW(9650)

Of course, the control must have its FontName property set to Arial, or some
other font that includes this character.
 
P

Patrick Jackman

Thanks very much Dirk.

I see that typing ?Hex(9650) into the immediate window will yeild
25B2

Is there a function to go the otherway; to convert a Hex value to decimal?

Patrick.
 
D

Dirk Goldgar

Patrick Jackman said:
Thanks very much Dirk.

I see that typing ?Hex(9650) into the immediate window will yeild
25B2

Is there a function to go the otherway; to convert a Hex value to decimal?


In the Immediate Window:

?&H25B2
9650

If you happen to have the hexadecimal value as a string, you can use the
Val() function to convert it:

S = "&H25B2" : ?Val(S)
9650
 

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