ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   assigning a macro to a button (https://www.excelbanter.com/excel-discussion-misc-queries/70866-assigning-macro-button.html)

Darby

assigning a macro to a button
 
I have a macro that runs fine and I added a button to my spreadsheet from
the forms control menu, but I can't figure out how to assign the macro to the
button.

I was expecting to see and "assign macro" option available when I right
click on the button, however it's not there.

Any ideas?

Thanks

flummi

assigning a macro to a button
 
Click the green triangle on the Controlbox Toolbar (design mode)
Right click your button.
From the context menu select View Code

between the lines
Private sub
and End sub

type the name of your macro.

Turn off design mode and test it.

Hans


Dave Peterson

assigning a macro to a button
 
You added a commandbutton from the control toolbox. You can either follow
flummi's advice or delete that commandbutton and add a button from the Forms
toolbar.

Darby wrote:

I have a macro that runs fine and I added a button to my spreadsheet from
the forms control menu, but I can't figure out how to assign the macro to the
button.

I was expecting to see and "assign macro" option available when I right
click on the button, however it's not there.

Any ideas?

Thanks


--

Dave Peterson


All times are GMT +1. The time now is 04:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com