Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default run macro only in certain file/worksheet

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!

  #2   Report Post  
Posted to microsoft.public.excel.programming
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!


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rename Worksheet Tab as File Name Using a Macro Cue Excel Discussion (Misc queries) 10 December 24th 09 06:38 PM
Enabling Macro with the worksheet file NSNR Excel Discussion (Misc queries) 2 October 26th 07 12:16 PM
Macro Save with Worksheet as file Name bbkixx Excel Programming 5 October 19th 06 05:25 PM
Copying worksheet to new file by macro Ruatha Excel Programming 2 June 11th 06 02:14 PM
using macro to save worksheet with unique file name Noell Excel Programming 3 October 15th 03 10:24 PM


All times are GMT +1. The time now is 09:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"