Run Macro from Toolbar

Smurfit-Stone

Active Member
Joined
Dec 1, 2004
Messages
485
Hello Board,
I have a spreadsheet that is shared between my company and different vendors. I want to attach a macro to it that does come calulations and clears some cells. My problem is that I want the macro assigned to an icon on the users (my companies users only) toolbar. What I have now is on the toolbar, but its on a separate spreadsheet that opens with Excel XLSTART, the problem is that this spreadsheet opens every time Excel is opened. Is there a way to put the icon the macro is assigned to on the toolbar with this separate workbook, or is there a way to get the macro to run as a Private Sub for the active workbook. The macro is listed below.

Private Sub SheetsVisible()
Dim wks As Worksheet
Sheets("Order").Activate
For Each wks In ActiveWorkbook.Worksheets
wks.Visible = True
Next wks
End Sub
 

Some videos you may like

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Watch MrExcel Video

Forum statistics

Threads
1,122,416
Messages
5,596,010
Members
414,037
Latest member
Roamingsmile

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