Hi,
In VBA userform I created a CommandButton1_Click which as a macro program behind it.
I have been trying to create a shortcut key like F9 so that when I run the module and complete various task, I can then hit F9 to enable CommandButton1_Click so that whatever the program behind it completes the data.
Thanks
Steve
Hi Steve,
What you're trying to do isn't totally clear and without your workbook again I can't see any code or the form.
Why not just create a sub that the command button calls, and then create a shortcut to run the same sub?
Phil
Hi Phil,
The database is too big but I figured this code out and works. But after looking into it, looks like there is no way of doing
A F9 key to initialize the cboSelect, which is my advanced filter. if you can confirm this that would be great.
Private Sub Userform_Initialize()
Me.cboSelect.List = WorksheetFunction.Transpose(Sheet5.Range("AA5:AB5"))
With Phonelist1
With .cmdCode
.Accelerator = "G"
.Enabled = True
End With
End With
End Sub
Steve
Hi Steve,
What about this?
Sub InitSub
Me.cboSelect.List = WorksheetFunction.Transpose(Sheet5.Range("AA5:AB5"))
With Phonelist1
With .cmdCode
.Accelerator = "G"
.Enabled = True
End With
End With
End Sub
Private Sub Userform_Initialize()
InitSub
End Sub
Sub InitSubShortcut
InitSub
End Sub
Modify the code as needed.
Then create a shortcut to the InitSubShortcut sub?
Cheers
Phil