Macro's particular to a Workbook

B

Bob Featherstone

I have a series of workbooks which perform accounting functions split into
monthly worksheets and an invoice tracker. I have generated macro's for
jumping around the worksheets and calling up results from the tracker.
Every year I copy the workbook for the new financial year and the macro's
copy with it.

However, when I use the macro's in the new workbook although macro's are
enabled initially, they ask me to re-initialise and it automatically opens
the previous years workbook for which they were constructed.

Is there any way to import the Macros or to re-set the document name to
which they apply. Or do I have to re-make the Macro's for every new
workbook........

Napalm Bob
 
M

MattShoreson

have you tried using thisworbook as an identifier.

for example, when coding, declare a workbook variable.
then assign thisworkbook to the variable.

This ensures you use the active book within the code blocks.

As for links... that's a different story
 

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