Insert Symbol in VBA

G

Gary''s Student

Can I insert a symbol in VBA just as I can in the worksheet with:

Insert > Symbol...

I would like to enter code like:

Sub symenterx()
ActiveCell.Value = "∰"
End Sub

rather than:

Sub symenter()
ActiveCell.Value = ChrW(8752)
End Sub
 
F

FSt1

hi
Activecell.value = chr(2)
look up "Character set" in vb help for a list.

regards
FSt1
 
B

Bernard Liengme

Yes. I used

Sub symenterx()
ActiveCell.Value = "£"
End Sub

I entered the UK pound sign with ALT+0163 (on number pad)
Not sure what code give your symbol
best wishes
 
G

Gary''s Student

Thank you. Using ALT+0163 enters pound symbol in both the worksheet and in
VBA. I tried ALT+3333 in the worksheet and got the Club symbol from a deck
of cards. This did not work in VBA.

I guess the ALT+ method can only be used for a subset of symbols in VBA
 

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