For keys that correspond to ASCII characters, you can use the Asc() function:
e.g. Asc("A") is 65, and 65 is also the value of vbKeyA.
It gets harder when you try to use non-ASCII characters, or lower case
characters, or characters which could be rendered by different keys - e.g. the
numeric keypad 3 has a different keycode than the typewriter keyboard 3 :
?vbkey3
51
?vbkeynumpad3
99
You can use the Object Browser to look at the KeyCodeConstants collection if
this is something you want to deal with.
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.