View Single Post
  #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