ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Run Macro for all worksheets (https://www.excelbanter.com/excel-worksheet-functions/151375-run-macro-all-worksheets.html)

saman110 via OfficeKB.com

Run Macro for all worksheets
 
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.

--
Message posted via http://www.officekb.com


Dave Peterson

Run Macro for all worksheets
 
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

"saman110 via OfficeKB.com" wrote:

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.

--
Message posted via http://www.officekb.com


--

Dave Peterson

saman110 via OfficeKB.com

Run Macro for all worksheets
 
Thank you.

saman110 wrote:
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.


--
Message posted via http://www.officekb.com



All times are GMT +1. The time now is 07:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com