Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Subtotal function
I have some VBA code that should subtotal a table based on the 1st column and then resubtotal on the second column. The problem I am having is that the second subtotal puts the "Section Total" label in the first column as well. Any ideas on what I am doing wrong? Thanks for the help: ColStart = 2 ColEnd = lvlColumn + 2 ReDim Columns(0 To (ColEnd - ColStart)) For i = ColStart To ColEnd Columns(i - ColStart) = i Next i ColSt = 2 ColEn = lvlColumn + 2 ReDim Columns2(0 To (ColEn - ColSt)) For n = ColSt To ColEn Columns2(n - ColSt) = n Next n With xlSheet.Range("A:ZZ") .Cells.Copy .Cells.PasteSpecial (xlPasteValues) .Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Columns, _ Replace:=True, PageBreaks:=False, SummaryBelowData:=True .Subtotal GroupBy:=2, Function:=xlSum, TotalList:=Columns2, _ Replace:=False, PageBreaks:=False, SummaryBelowData:=True End With |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using Subtotal function | Excel Discussion (Misc queries) | |||
Embed a countif function in subtotal function? | Excel Worksheet Functions | |||
How do I nesting subtotal function within average function in Exc | Excel Worksheet Functions | |||
Subtotal function | Excel Worksheet Functions | |||
subtotal function | Excel Programming |