Common set of macros

R

robot

Hello,

I have a workbook with buttons on some of the worksheets, click-event
handlers, automacros and general macros. I made four copies of the workbook,
modified some headings, and shared them for data input by four different
groups of people. Everything works fine until I need to make changes to
event-handlers and macros: Any change in VBA code must be done four times,
once for each of the four WBs.

There ought be a better way to do this. Suggestions are most welcome. (I use
Excel XP).
 
R

RyanH

You could put all your code in a separate workbook and make that workbook an
add-in. Just reference the Add-In Workbook on your Button Click Events.
Making the workbook an Add In will enable you to only have to correct one
workbook instead of four. Just choose the workbook with the code and Save As
Type > Add In

Hope this helps! If so, let me know or just click "Yes" below
 
R

robot

Thanks RyanH for your reply.

I am now exploring how to proceed. Expounding on your idea, I guess I have
to:
1. Save one of the workbooks as an Addin, and rewrite event handlers and
automacros as procedures with exact same parameters.
2. Replace all code of event handlers and automacros with procedure
calls;
3. Set reference to the Addin for each of the 4 workbooks.

That will be quite some work to do!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top