Macro in sheet

  • Thread starter Thread starter chalky
  • Start date Start date
C

chalky

Ok i have a macro that is written in a template workbook. The idea i
that the template is then copied into a variety of sheets and the macr
is run to pick up various pieces of standing data, what i am strugglin
with is a way of ensuring the macro stays with the sheet when it i
copied into a new work book.

Any ideas
 
Put the macro inthe code module for the sheet that will be copied to the
other workbooks. The macro will be copied with the sheet.

If your macro is a user-defined function which is called from the worksheet,
the code must be in a VBA code module. The following link to Erlandsen Data
Consulting's VBA site has code for copying a module from one workbook to
another:

http://www.erlandsendata.no/english/index.php?d=envbavbecopytowb

Hope this helps,

Hutch
 

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

Back
Top