Running macros on ALL Excel tabs

T

tbong

Can I create a Macro and have it run on all tabs in the Excel workbook?

I have tried to do this by creating a macro and within the macro move from
tab to tab. When I then run the macro, Excel promps me to debug at the very
point that is should move onto the next tab.
The macro itself is a simple one and only includes formatting, sorting, &
subtotaling commands.
The problem is I have 30+ reports each with 15+ tabs and need this macro to
run on all tabs.... a very time consuming task if I have to run it tab by tab.

Any help would be greatly appreciated!
 
O

Otto Moehrbach

Something like this maybe:
Sub DoThisEachSht()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
'Your code goes here
Next ws
End Sub
 
Top