Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
GBO GBO is offline
external usenet poster
 
Posts: 2
Default macro excel subtotal in subtotal

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default macro excel subtotal in subtotal

You may find creating a pivottable is quicker.



GBO wrote:

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
  #3   Report Post  
Posted to microsoft.public.excel.misc
GBO GBO is offline
external usenet poster
 
Posts: 2
Default macro excel subtotal in subtotal

pivottable is not an option for the client
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
How do I Subtotal, then Sort by Subtotal Amounts? dnamertz Excel Discussion (Misc queries) 3 October 29th 06 12:17 AM
pasting to subtotal lines without replacing hidden -non-subtotal l harleydiva67 Excel Discussion (Misc queries) 1 October 12th 06 06:02 PM
Bolding the subtotal lines automaticlly When using the Subtotal fu 06Speed6 New Users to Excel 2 October 5th 06 03:52 PM
copy subtotal value only, subtotal value can be vlookup by others BB Excel Discussion (Misc queries) 1 June 28th 06 11:10 PM
Subtotal of Subtotal displays Grand Total in wrong row Thomas Born Excel Worksheet Functions 5 January 6th 05 01:46 PM


All times are GMT +1. The time now is 10:41 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"