---
Message posted from http://www.ExcelForum.com/
Application.OnKey "{F1}", "UnHide"
Where "F1" is the button you're assigning the macro to and "UnHide" is
the name of the macro. Lookup "OnKey" in VBA Help for a list of the
keys names to use. - Pikus
Private Sub CommandButton1_Click()
Application.OnKey "{CommandButton1}", "Macro1"
End Sub
However it isn't working. Any idea why?
View>Toolbars in the Menu bar
Check Forms or Control Toolbox
On a button from the Forms Toolbar you can right click and assign a macro
If you have a button from the Control Toolbox
Press the first button on the Control Toolbox toolbar to go into the design mode
Double click on the button you placed on your worksheet.
The VBA editor will open with this
Private Sub CommandButton1_Click()
End Sub
You can place the code in the event or place the macroname in the event.
Press Alt-q to go back to Excel and press the first button on the Control Toolbox again to exit the design mode
--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl
"jamie85 >" <<jamie85...@excelforum-nospam.com> wrote in message news:jamie85...@excelforum-nospam.com...
Private Sub CommandButton1_Click()
Call Macro1
End Sub
Let me know if you have any more problems. - Pikus
right click on the grey tool bar at the top and pick the "Forms"
toolbar.
it will open a toolbar with a bunch of things you can add to your
sheet
select the button (looks like a grey rectangle) and then click on the
worksheet and that should add a button to your worksheet.
And it will ask you to assign a macro. Select the one you want with
that button, and then say "OK"
you can change the Caption and size. If this doesn't work let me know,
I just had to figure this out recently.
--
Regards,
Tom Ogilvy
"pikus >" <<pikus....@excelforum-nospam.com> wrote in message
news:pikus....@excelforum-nospam.com...