Hey gurus,
I'm trying to use Application.OnKey commands for upper and lower case letters, but it seems like Excel always uses upper case letters (chars 65 to 90) rather than using lower case letters (chars 97 to 122).
To be more specific: When I activate OnKey calls for all letters (65:90 and 97:122) and I press a lower case letter such as "e" I should get the character number 101, but instead I get the character number 69.
Can anyone shed some light on this?
Code
Public Sub KeyEventOn()
Dim iCount As Integer 'index for ASCII characters
For iCount = 65 To 90
Application.OnKey "{" & iCount & "}", "'MySub """ & iCount & """'"
Next
For iCount = 97 To 122
Application.OnKey "{" & iCount & "}", "'MySub """ & iCount & """'"
Next
End Sub
Public Sub KeyEventOff()
Dim iCount As Integer 'index for ASCII characters
For iCount = 65 To 90
Application.OnKey "{" & iCount & "}"
Next
For iCount = 97 To 122
Application.OnKey "{" & iCount & "}"
Next
End Sub
Public Sub MySub(ByVal KeyCode As Long)
MsgBox KeyCode
end sub
Display More