mikewild2000,
How do i assign the "q" key to operate my "commandbutton1" code?
Can't be done.
but...............................
Create a new macro in a regular module.
For arguments sake, name it "MyCommButtCode"
Now cut and paste everything in the CommandButton1
code (between the Sub & End Sub) and paste it into
this new sub.
In the CommandButton1 code, call the new sub
Private Sub CommandButton1_Click()
MyCommButtCode
End Sub
Now, from the VBA editor in the Immediate window, type the following:
Application.MacroOptions Macro:="MyCommButtCode", Description:="",
ShortcutKey:="q"
and then press <enter>.
Even a little easier................
Record a macro (any name) and assign the shortcut key.
Delete the code in that macro, replace it with your CommandButton
code and then just call that macro from your CommandButton.
John