run macro only in certain file/worksheet

  • Thread starter Thread starter huepf
  • Start date Start date
H

huepf

Hi,

I want to make sure that a macro only runs in one certain file.

I was thinking to get check the file name of the open file and run the
program only if it's the right file. Is there an easier way to do
that?

If not, how do I get the file name of the open and active worksheet?

thanks!
 
Activesheet.name returns the sheet name, activeworkbook.name the file
 

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

Back
Top