Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sub Totals - URGENT
I have the following piece of code to create sub-totals
across a range of data. The Excel sub total method actually does 3 sweeps to create totals on fields 1, 4 and then 6. Using the showlevel buttons I then format the subtotals at various levels. This works great except that I now need to introduce another 2 subtotals. When I coded this and tested it, the showlevel buttons only went up to 8 and the expand/contract lines didn't select the data I'd expected it to. Also I got an error message something like subscript out of range. Is there a limit to subtotals and if so what could I use as an alternative other than Pivot Tables? Can anyone help, this is really urgent. Many thanks Jacqui Below is the original code which works absolutely fine based on 3 sweeps. With ActiveSheet .UsedRange.Subtotal groupby:=1, Function:=xlSum, totallist:=colArray, _ Replace:=True .UsedRange.Subtotal groupby:=4, Function:=xlSum, totallist:=colArray, _ Replace:=False .UsedRange.Subtotal groupby:=6, Function:=xlSum, totallist:=colArray, _ Replace:=False End With ActiveSheet.Outline.ShowLevels 6 Application.StatusBar = "Applying formats to Sub Totals" With ActiveWorkbook .Styles("rowlevel_6").Font.Bold = True With .Styles("rowlevel_5").Font .Bold = True .Italic = True End With End With ActiveSheet.Outline.ShowLevels 7 etc, etc |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
IME MODE FOR EXCEL 2007 (URGENT URGENT) | Excel Discussion (Misc queries) | |||
Pivot Totals: Group totals different from Grand totals | Excel Discussion (Misc queries) | |||
how to enter totals and sub totals from receipts into excel. | New Users to Excel | |||
Summing Weekly Totals into Monthly Totals | Excel Worksheet Functions | |||
Comparing/matching totals in a column to totals in a row | Excel Worksheet Functions |