View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Activating a command button with a single key stroke

Use the keydown event of the command button. or the userform..

Private Sub CommandButton1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 65 Then MsgBox "Run"
End Sub
--
If this post helps click Yes
---------------
Jacob Skaria


"Bishop" wrote:

Is there a way to activate a command button by simply pressing a single
letter on the keyboard? For example, say I have a button that says "Add A
Title". When I press the A key I want the button to activate and process
whatever code is attached to it.