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

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

DominicB

Well-known Member
Joined
Oct 3, 2005
Messages
1,569
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
 

Carolyn Kelley

New Member
Joined
Oct 16, 2006
Messages
3
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
 

DominicB

Well-known Member
Joined
Oct 3, 2005
Messages
1,569
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
 

Forum statistics

Threads
1,137,366
Messages
5,681,074
Members
419,950
Latest member
BeckiJae

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
Top