Run Macro for all worksheets

  • Thread starter saman110 via OfficeKB.com
  • Start date
S

saman110 via OfficeKB.com

Hello All,

I have many worksheets and I have a macro that I want to run for each
worksheet. Is there any way I could save my fingers some pain instead of
going throw all worksheets and run the macro could run the macro for all
worksheets at once.


Thanks.
 
D

Dave Peterson

You can have another macro that calls your macro:

Option Explicit
Sub RunAll()
dim wks as worksheet
for each wks in activeworkbook.worksheets
wks.select
call yourmacronamehere
next wks
end sub
 
S

saman110 via OfficeKB.com

Thank you.
Hello All,

I have many worksheets and I have a macro that I want to run for each
worksheet. Is there any way I could save my fingers some pain instead of
going throw all worksheets and run the macro could run the macro for all
worksheets at once.

Thanks.
 
Top