M
masterbaker
I have some VB that SHOULD subtotal each tab that is not equal to "Source
Data" but when I run the Macro it subtotals multiple times on the same tab
instead of moving to the next tab after subtotaling. Can anyone help me
straighten out my For statement? Here's the Macro:
For Each ws In ActiveWorkbook.Sheets
If ws.Name <> "Source Data" Then _
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Subtotal GroupBy:=2, Function:=xlSum, TotalList:=Array(11, 12,
13 _
, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23), Replace:=True,
PageBreaks:=False, _
SummaryBelowData:=True
Next ws
Data" but when I run the Macro it subtotals multiple times on the same tab
instead of moving to the next tab after subtotaling. Can anyone help me
straighten out my For statement? Here's the Macro:
For Each ws In ActiveWorkbook.Sheets
If ws.Name <> "Source Data" Then _
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Subtotal GroupBy:=2, Function:=xlSum, TotalList:=Array(11, 12,
13 _
, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23), Replace:=True,
PageBreaks:=False, _
SummaryBelowData:=True
Next ws