Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / General Excel Questions / November 2007

Tip: Looking for answers? Try searching our database.

macro excel subtotal in subtotal

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
GBO - 29 Nov 2007 10:40 GMT
For a sub total in another subtotal I'm look ing for the second
selection. at the moment I'm using this code but this takes very long
(it repeats 80 times for 140.000 rows in total)

Does anyone have a sugestion tot select the data  my second subtotal

' first selection

   Range("A1").Select

   Range(Selection, Selection.End(xlToRight)).Select
   Range(Selection, Selection.End(xlDown)).Select

   Selection.Subtotal GroupBy:=19, Function:=xlSum,
TotalList:=Array(13, 17) _
       , Replace:=True, PageBreaks:=False, SummaryBelowData:=True

' second selection

   Cells.Select

   Selection.Subtotal GroupBy:=6, Function:=xlSum,
TotalList:=Array(13, 17), _
       Replace:=False, PageBreaks:=False, SummaryBelowData:=True
Dave Peterson - 29 Nov 2007 12:46 GMT
You may find creating a pivottable is quicker.

> For a sub total in another subtotal I'm look ing for the second
> selection. at the moment I'm using this code but this takes very long
[quoted text clipped - 20 lines]
> TotalList:=Array(13, 17), _
>         Replace:=False, PageBreaks:=False, SummaryBelowData:=True

Signature

Dave Peterson

GBO - 29 Nov 2007 14:15 GMT
pivottable is not an option for the client
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.