Is there a way to convert a string to keycode?
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.