ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I display the ASCII code of a key (https://www.excelbanter.com/excel-programming/394046-how-do-i-display-ascii-code-key.html)

Jim[_69_]

How do I display the ASCII code of a key
 
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



John Bundy

How do I display the ASCII code of a key
 
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

--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Jim" wrote:

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





All times are GMT +1. The time now is 07:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com