How do I Launch a Macro on a different sheet

  • Thread starter Thread starter Pepe
  • Start date Start date
P

Pepe

I'm stuck on this one. Basically, I have one spreadsheet
that when it opens, it will automatically open another spreadsheet.
Then what I'd like to have happen is to have a macro run on that newly
opened spreadsheet.

Example: test.xls is opened and through OpenNew macro, another
spreadsheet called target.xls is opened. I then need a macro
Refresh_Data on target.xls to run.

I don't want to have anything written into target.xls to automatically
run Refresh_Data when the spreadsheet is opened however since other
people open and work with it. I need to have Target.xls opened and
the Refresh_Data macro run by having something written into text.xls.

Does that make sense? If there is an easier method than what I was
thinking of, please recommend.

Thanks in advance.

Paul
 
Paul,

Use the Application.Run method. E.g.,

Application.Run "target.xls!Refresh_Data"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Back
Top