Run Macro for all worksheets

  • Thread starter Thread starter saman110 via OfficeKB.com
  • Start date 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.
 
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
 
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.
 
Back
Top