Toolbox Buttons and Macros

Carolyn Kelley

New Member
Joined
Oct 16, 2006
Messages
3
I just inserted a button using the Control Toolbox. How can I now make this button run a macro or function?
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Good evening Carolyn Kelley

Welcome to the board.

From "Design Mode" double click on the button.
Copy (or type) the code into the pane that appears.
Close the VBE (the environment you have just opened).
Exit design mode.

HTH

DominicB
 
Upvote 0
Toolbar Button Macros

Thank you for the quick reply DominicB.

I see now the VBE window and desire to insert a macro that requires mousing commands rather than keyboard string formula function. For example: Mouse to highlight row, Insert row, copy range of cells, paste in range of cells in newly inserted row. End.

Any suggestions?

Thank you
Carolyn Kelley
 
Upvote 0
Hi Carolyn Kelley

If you are a beginner at macros I would suggest you do the following :

Record the actions you wish to do using the macro recorder (Tools > Macro > Record New Macro).
Draw your button using the Forms toolbar (these controls are easier to use than the Control Toolbox).
Once you've drawn the button right-click and select Assign Macro to assign a macro to the button.
Once this is done the macro will be executed every time you click the button.

Good luck! :)

HTH

DominicB
 
Upvote 0

Forum statistics

Threads
1,215,055
Messages
6,122,902
Members
449,097
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top