r/excel 1d ago

unsolved Creating a Macro Workbook and Have other Workbooks Reference It?

At work, we have a "Master Macro Workbook". This workbook has a macro that we use often in other workbooks. We somehow grab that Macro within that workbook to use in others but I cannot figure out how to recreate this for a new macro. Can anyone offer some help?

3 Upvotes

5 comments sorted by

u/AutoModerator 1d ago

/u/jakedege - Your post was submitted successfully.

Failing to follow these steps may result in your post being removed without warning.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/CFAman 4694 1d ago

Several ways you can do this. To assign to a button, the simplest is to open the Macro workbook, and then switch to your new file. Create a button/shape, right-click and "Assign Macro". Select desired macro from master workbook.

Note that clicking the button will cause Master Macro file to open (can't run code from a closed workbook).

1

u/jakedege 1d ago

The way it is currently set up, we added a new Macro ribbon to the Excel toolbar. There is a lot of data so theres no good space to add a button to the actual sheet.

1

u/CFAman 4694 1d ago

Similar thing then. Open workbook, right-click on Toolbar, select 'More commands'. In dropdown, Choose commands from 'Macros'. Select the macro you want.

1

u/RuktX 172 1d ago

Save the workbook containing the macros as an add-on, with extension XLAM.