Running macros on ALL Excel tabs

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!
 
Something like this maybe:
Sub DoThisEachSht()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
'Your code goes here
Next ws
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top