Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Loop through the sheets using something like:
For i = 1 To Worksheets.Count 'Your code here Next i HTH, John |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thanks a lot.
sorry for my ignorance, but where do i write this? how do i start a new macro like this one. Eron |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro for running on preotected sheets | Excel Discussion (Misc queries) | |||
Running macro on file open | Excel Discussion (Misc queries) | |||
If I have my sheets protected will that prevent me running a macro to hide certain sells? | Excel Worksheet Functions | |||
calc locks up after running a macro that moves sheets to a new fil | Excel Discussion (Misc queries) | |||
Running .BAT file from within a macro... | Excel Programming |