How do I convert char into integer in Excel VBA?

G

Guest

Hi all,
I am trying to do a little programming exercise with Excel VBA, I have
seen the way that converting integer into char and I want to try the way that
converting char into integer. I was using Int() as the converter... but after
I have seen the spec and I noticed that I was wrong of using this function.
I tried to subtract the char with 64, well... stupit me and the type was
not match LOL. So that, is it possible to convert char into int in any other
way?

Thanks
 
R

raypayette

Sub test()
MsgBox Asc("a")
End Sub

will display 97 that is the ASCII integer for "a".
Do NOT do this in the spreadsheet: =ASC("a")
 

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