KeyAscii

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What is KeyAscii and where is a good website or page that will describe this
and detail this for me?
 
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
 

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

Back
Top