run macro before closing if worksheet name is fixed

J

Jaan

Hi All

How can I create macro if worksheet name is ex."Template" before closing
workbook? I use this sheetname in more then ten workbooks

Best regards
 
M

Mike Fogleman

If you are asking how to refer to a worksheet with the same name in several
different workbooks, then you would include the workbook name also:

Workbooks ("MyBook").Worksheets ("Template")
Workbooks ("MyBook2").Worksheets ("Template")
Workbooks ("MyBook3").Worksheets ("Template")
etc...
Mike F
 
J

Jaan

Hi Simon
I want to check all my workbooks. If the workbook what i will close contain
sheet "Template", then must run "MyMacro".The Mike solution is not this what
I want, because I create severel workbooks every day with worksheet
"Template".
As many I get the picture, this solution need rewrite macro each time I will
create new workbook

Best regards


"Simon Lloyd" kirjutas:
 

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