Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to create a button on a worksheet that will "toggle"
Subtotal on and off. I came up with this code, but it doesn't work. The 2nd line (If Selection.SubTotal = False Then) is the offending line. What would be the correct syntax? Sub SubtotalOnOff() Range("A8").Select If Selection.SubTotal = False Then Selection.SubTotal GroupBy:=3, Function:=xlSum, TotalList:=Array(5, 6), _ Replace:=True, PageBreaks:=False, SummaryBelowData:=True ActiveSheet.Outline.ShowLevels RowLevels:=2 Else Selection.RemoveSubtotal End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Subtotal To Include Item Description On Subtotal Line | Excel Discussion (Misc queries) | |||
sort macro, subtotal and add lines after subtotal | Excel Discussion (Misc queries) | |||
pasting to subtotal lines without replacing hidden -non-subtotal l | Excel Discussion (Misc queries) | |||
Subtotal of Subtotal displays Grand Total in wrong row | Excel Worksheet Functions | |||
Sort, Subtotal, Label Subtotal, Insert row | Excel Programming |