Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If file name = 'abc', then run macro1

Status
Not open for further replies.

dalex17

Technical User
Jul 14, 2002
96
0
0
US
Hi,

Is it possible to execute a specific macro depending on a file name? In other words, I have created macro1, macro2, and macro3, and would like for macro3 to run every time the file name abc.xls is opened.

Any replies would be much appreciated.

Please note that macro1, macro2 & macro3 are personal.xls macros and that the reason why I am trying to accomplish this is so that whenever file abc.xls is replaced (i.e. written over, saved over by another file, etc...), I will not not lose the functionality of the macro.

dalex

dalex
 
Create an Auto_Open macro for file ABC.xls in VB,
with macro3 within, when the file is opened the macro will execute automatically.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top