Subtotal Macro Through Numerous Tabs

  • Thread starter Thread starter Guest
  • Start date Start date
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!
 
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

Similar Threads

Calculating subtotals 22
Subtotal Macro Help 2
labels for subtotals 1
Subtotal Formatting 2
Issue with nested data subtotals 3
My Never ending ARRAY code problems 18
variable page breaks 1
TOUGH MACRO - DARE TO CODE IT 10

Back
Top