How do I display the ASCII code of a key

J

Jim

I would like to display the ascii code of a key after it is pressed.
Presumably a MsgBox would suffice - Can some point me to a piece of suitable
code

Regards & TIA
 
G

Guest

Was not able to do this personally in a sheet, just on a form

Private Sub workbook_KeyPress(ByVal KeyAscii As _
MSForms.ReturnInteger)

MsgBox KeyAscii
'To handle keyboard combinations (using SHIFT,
'CONTROL, OPTION, COMMAND, and another key),
'or TAB or ENTER, use the KeyDown or KeyUp event.
End Sub
 

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