LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Running a one macro on all sheets within the file

In your workbook with the 100 sheets you would go to a general module
(Insert Module) and put in the code

Sub Run100()
Dim sh as Worksheet
for each sh in thisworkbook.Worksheets
sh.Activate
application.Run "MyAddinName.xla!MyMacroName"
Next
End sub

Then you would go to Excel and choose

Run100 in Tools=Macros=macro and hit the run button.

Obviously you would change "MyAddinName.xla!MyMacroName" to the name of
the addin and the name of the macro in that addin that you want to run.

--
Regards,
Tom Ogilvy


"Eron" wrote in message
oups.com...
Hi All,

I am using excel 2003.

I would like to know if anyone knows how to run one macro on all sheets
within the file.

Today I have a spread sheet with over 100 sheets. In order to receive
the my final outcome I need to run the same macro 100 times (in each
sheet). The macro I am using is an add in macro.

There must be a way i could run a macro that will do the job for me.

I would really appreciate if some one could give me an answer.

Eron



 
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
Macro for running on preotected sheets Yogin Excel Discussion (Misc queries) 3 July 23rd 08 05:37 PM
Running macro on file open excelnerd Excel Discussion (Misc queries) 3 March 12th 08 10:51 PM
If I have my sheets protected will that prevent me running a macro to hide certain sells? Marc Excel Worksheet Functions 0 May 17th 06 11:36 PM
calc locks up after running a macro that moves sheets to a new fil shibao Excel Discussion (Misc queries) 0 November 7th 05 10:58 PM
Running .BAT file from within a macro... Trevor[_4_] Excel Programming 4 April 3rd 04 12:54 AM


All times are GMT +1. The time now is 12:24 PM.

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

About Us

"It's about Microsoft Excel"