Consolidating Macros Into Single Workbook

  • Thread starter Thread starter sylvain.gaillard
  • Start date Start date
S

sylvain.gaillard

I have created 3 different Macros each saved in its own workbook.
Is there a way to consolidate everything into a single workbook ?
Thanks for your help.
 
Macro can be copied and pasted from any workbook to any other workbook. The
only problems is if the workbook name is specifically called out in a macro.
I usually make the following change

add
Myworkbook = thisworkbook


Change statements like this
from
workbook("book1.xls")
to
workbook(Myworkbook.name)
 
You may want to copy them and place them into your Personal.xls so's they are
available for all open wotkbooks.

When you go to Tools>Macro>Record New Macro a dialog box will open to name the
macro.

Also where to store it.

Select "Personal Macro Workbook" to record to.

This will record the macro into Personal.xls which is stored by Excel in your
XLSTART folder.

You can copy your existing macros into a standard module in the Personal.xls you
just created.

Any references to workbooks or worksheets should probably be changed to
Activeworkbook and Activesheet but you are the judge or that.

Remember to save it as "Hidden" so's it opens in the background.


Gord Dibben MS Excel MVP
 
Back
Top