Hi,
Sorry my mistake in the title, dunno how to edit.
Might be something easy for a vba pro, but don't get why I receive a 'run time error 1004 - METHOD RANGE OF OBJECT_WORKSHEET FAILED ' for the below one.
Sub Master_Subtotal()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> "Master" And ws.Name <> "Amount" Then
ws.Range("A1:AT").Subtotal GroupBy:=46, Function:=xlSum, TotalList:=Array(12), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
ws.Outline.ShowLevels RowLevels:=2
End If
Next ws
Application.ScreenUpdating = True
End Sub
Thnks
Sorry my mistake in the title, dunno how to edit.
Might be something easy for a vba pro, but don't get why I receive a 'run time error 1004 - METHOD RANGE OF OBJECT_WORKSHEET FAILED ' for the below one.
Sub Master_Subtotal()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> "Master" And ws.Name <> "Amount" Then
ws.Range("A1:AT").Subtotal GroupBy:=46, Function:=xlSum, TotalList:=Array(12), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
ws.Outline.ShowLevels RowLevels:=2
End If
Next ws
Application.ScreenUpdating = True
End Sub
Thnks