Insert a symbol using VBA

R

RyanH

Here is the symbol I am trying to insert: â–º. Here is the properties of it:
Arial, Geometric Shapes, Character Code 25BA, Unicode(hex).

When ever I use this code the line below shades red, why?

ActiveCell.Value = ChrW(25BA)
 
G

Gary''s Student

Argument needs decimal, not hex:

Sub dural()
ActiveCell.Value = ChrW(9658)
End Sub
 
A

Andy Pope

Hi,

You need to let it know it's a hex value

ActiveCell.Value = ChrW(&H25BA)

Cheers
Andy
 
P

Peter T

Simplest way is just to memorise all the 65k character codes in Hex format,
but you could cheat and embrace with &Hxxxx&

Regards,
Peter T
 
C

Chip Pearson

How did you know that 25BA = 9658?

In the Immediate Window of VBA....

?&H25BA


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 

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