L
Lisa
I'm trying set up a user form where I can assign shortcut keys to various
subroutines.
I know how to do the keybinding (assign the shortcut keys) once I get the
keys in the text box -- but am totally stumped on how to "capture" the
keystrokes the user might enter in the form's text boxes.
Unfortunately I'm pretty much a newbie with programming in general and VBA
in particular...
Am working on trying to get something like the following to work, but even
if I can get this running right, it seems I'd need to specify every possible
key combo. I'm sure that can't be the most reasonable approach...
I'd really appreciate any advice or help you can offer!
Private Sub Texbox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
' If the 'Alt' and 'E' keys are pressed,
If e.Alt And e.KeyCode = Keys.e Then
Texbox1.Value = "Alt + E"
Else
Texbox1.Value = "nope"
End If
End Sub
subroutines.
I know how to do the keybinding (assign the shortcut keys) once I get the
keys in the text box -- but am totally stumped on how to "capture" the
keystrokes the user might enter in the form's text boxes.
Unfortunately I'm pretty much a newbie with programming in general and VBA
in particular...
Am working on trying to get something like the following to work, but even
if I can get this running right, it seems I'd need to specify every possible
key combo. I'm sure that can't be the most reasonable approach...
I'd really appreciate any advice or help you can offer!
Private Sub Texbox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
' If the 'Alt' and 'E' keys are pressed,
If e.Alt And e.KeyCode = Keys.e Then
Texbox1.Value = "Alt + E"
Else
Texbox1.Value = "nope"
End If
End Sub