ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   KeyAscii (https://www.excelbanter.com/excel-programming/390569-keyascii.html)

Shawn

KeyAscii
 
What is KeyAscii and where is a good website or page that will describe this
and detail this for me?


--
Thanks
Shawn

Gary''s Student

KeyAscii
 
KeyAscii is a parameter associated with the KeyPress event (usually
associated with forms or controls). Checkout VBA Help for either topic or

http://msdn2.microsoft.com/en-us/lib....keypress.aspx


--
Gary''s Student - gsnu200726


"Shawn" wrote:

What is KeyAscii and where is a good website or page that will describe this
and detail this for me?


--
Thanks
Shawn


moon

KeyAscii
 
KeyAscii is a variable which holds the ascii value of a key when it's
pressed. So if you press 'A', KeyAscii will be 65, if you press 'B',
KeyAscii will be 66, etc.

You can easily test this with a UserForm and a TextBox called TextBox1:


Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)

MsgBox KeyAscii & " = " & Chr(KeyAscii)

If KeyAscii = 32 Then

MsgBox "You pressed the space bar"

End If

End Sub



"Shawn" schreef in bericht
...
What is KeyAscii and where is a good website or page that will describe
this
and detail this for me?


--
Thanks
Shawn




Rick Rothstein \(MVP - VB\)

KeyAscii
 
KeyAscii is a parameter associated with the KeyPress event (usually
associated with forms or controls). Checkout VBA Help for either topic
or

http://msdn2.microsoft.com/en-us/lib....keypress.aspx


Since VBA is not a .NET language, I think this link would be a more
comfortable reference...

http://msdn2.microsoft.com/en-us/lib...99(VS.60).aspx

Rick



All times are GMT +1. The time now is 12:29 PM.

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