0
votes

It is possible to change the "location" of the macro that runs when clicking on a custom button that was added to the ribbon?

Let me explain the situation:

I'm starting from a template (let's say template.xltm, so my temporary file is template01) , which contains that ribbon code.

I save that template-sheet into the file I want, let's say file1.xlsm. Now I want to click that button again in the ribbon, the code should be run from the file1.xlsm macro (that has the same function name) and not from that template file (template.xltm).

1

1 Answers

0
votes

Adding the macro to the ribbon should be enough as the macro will run on the file it was activated from rather then the file it is stored in.

I have a whole bunch of different macros that I use regularly and needed quick and simple way to access it so I designated a workbook for my macros and created a custom tab with buttons for all macros I need.