run macro before closing if worksheet name is fixed

  • Thread starter Thread starter Jaan
  • Start date Start date
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
 
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
 
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:
 
Back
Top