View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Sam Wilson Sam Wilson is offline
external usenet poster
 
Posts: 523
Default run macro only in certain file/worksheet

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

"huepf" wrote:

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!