Assign Macro to Button

jkgreen

Board Regular
Joined
Nov 25, 2008
Messages
57
I have recorded a macro and put a button on my spreadsheet. Now how do I link the two?

Thanks,
Jason
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
The button I created is on the spreadsheet itself and not in a toolbar. I don't know if that will make a difference.
 
Upvote 0
If your button is from the Forms Toolbar, it should give you the option to "Assign Macro" If it from the Control ToolBar, you will need to access "View Code"

lenze
 
Upvote 0
I was able to copy the macro code from the editor and paste it in the button View Code editor.

Thanks for the input.
 
Upvote 0
The control and forms controls can be confusing. Try this: (1) place a simple object on the spreadsheet with the drawing tool. (2) type the button name the drawing object. (3) try right clicking on the object to get the window that has an option "Assign macro". good luck.
 
Upvote 0

Forum statistics

Threads
1,214,899
Messages
6,122,155
Members
449,068
Latest member
shiz11713

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