Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IME MODE FOR EXCEL 2007 (URGENT URGENT) Stella Wong Excel Discussion (Misc queries) 1 August 23rd 08 11:16 PM
Pivot Totals: Group totals different from Grand totals PsyberFox Excel Discussion (Misc queries) 1 February 13th 08 06:16 PM
how to enter totals and sub totals from receipts into excel. mjd23 New Users to Excel 2 January 11th 08 01:54 AM
Summing Weekly Totals into Monthly Totals steph44haf Excel Worksheet Functions 3 July 5th 06 04:51 PM
Comparing/matching totals in a column to totals in a row Nicole L. Excel Worksheet Functions 3 January 27th 05 10:42 PM


All times are GMT +1. The time now is 05:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"