View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Subtotals in Excel object model

He was asking how to determine the users settings (what options did the user
select) after running subtotal manually.

--
Regards,
Tom Ogilvy


"Kaboki" wrote in message
...
The way i right most of my vba for excel is to first record what I want
then I edit the macro and get exactly what I want

Range("B5").Select ' needs to be within the data area or assign a
selection name
Selection.Subtotal , Function:=xlSum, TotalList:=Array(4), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
Selection.Subtotal , Function:=xlSum, TotalList:=Array(4), _
Replace:=False, PageBreaks:=False, SummaryBelowData:=True
Selection.Subtotal , Function:=xlSum, TotalList:=Array(4), _
Replace:=False, PageBreaks:=False, SummaryBelowData:=True


groupby is like collumn 1 , 2 ,3 etc

XlConsolidationFunction can be one of these XlConsolidationFunction
constants.
xlAverage
xlCount
xlCountNums
xlMax
xlMin
xlProduct
xlStDev
xlStDevP
xlSum
xlUnknown
xlVar
xlVarP

totallist looks like a width of table type of thing

apply this function to one button and then apply this to another

Range("B5").Select

Selection.RemoveSubtotal

to remove it

I hope this helps I hate coding in excel



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/