Subtotal Macro Through Numerous Tabs

G

Guest

I'm looking for a macro that will subtotal data on each tab in a worksheet
that has many tabs - and which the number of tabs fluctuates. Basically:

(unsorted source data in sheet1, data sorted by account # on each tab
starting in sheet2)

Subtotal at change in column B; Sum columns A - K for sheet2, then again on
sheet3, and so on until there are no more tabs.

Thanks!
 
G

Guest

Sub sumworksheets()

Subtotal = 0

For Each ws In Worksheets

If ws.Name <> "Sheet1" Then

Subtotal = Subtotal + WorksheetFunction.Sum(Range("A1:B21"))

End If

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

Top