Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
userform
G'day Group,
How is a connection from a command button made to a macro. For instance if I wanted to push a button to run a macro that I created by using the recorder. Thanks Bruce |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
userform
Bruce
The commandbuttons on userforms use events (as do all controls). Specifically, you want the Click event of the commandbutton. Right-click on the commandbutton and choose View Code. Now you have two options (at least). You can paste your recorded code into the Click event, or you can call your recorded macro from within the event sub. If you paste, be sure to omit the Sub and End Sub lines from the recorded macro. The Sub line for event macro is pre-defined and should not be altered. To call the recorded macro (let's say it's named macro1), the event sub would look like this: Private Sub CommandButton1_Click() macro1 End Sub -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. "Bruce Minty" wrote in message ... G'day Group, How is a connection from a command button made to a macro. For instance if I wanted to push a button to run a macro that I created by using the recorder. Thanks Bruce |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA userform | Excel Worksheet Functions | |||
Userform to appear on top? | Excel Discussion (Misc queries) | |||
Userform | Excel Worksheet Functions | |||
userform | New Users to Excel | |||
userform | Excel Programming |