Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple subtotals

Status
Not open for further replies.

nfrichar

Programmer
Sep 15, 2003
4
GB
Hi

I need to write a macro to add different types of sub totals to an excel sheet. I want to count one column and then sum others. I want then what the sheet to only display the sub totals, but leave the user the ability to drill down onto the underlying data

Any ideas



 
Hi,

Have you looked at Data/Subtotals...

Skip,

[glasses] [red]Be advised:[/red] When you ignite a firecracker in a bowl of vanilla, chocolate & strawberry ice cream, you get...
Neopolitan Blownapart! [tongue]


 
Hi Skip

Looked at Data/SubTotals but this will only allow me to sum all coulms or count all columns. I want to mis this up. Count say column a, sum columns b,c,d
 


What you want can be done with TWO data/Subtotal operation. Just UNCHECK Replace Current Subtotals and change the aggregation criteria.

Skip,

[glasses] [red]Be advised:[/red] When you ignite a firecracker in a bowl of vanilla, chocolate & strawberry ice cream, you get...
Neopolitan Blownapart! [tongue]


 
Skip
Tried this but this gives me a new line for each subtotal which I do not want.


 


So you use one of them, like the sum and stuff the count in with a procedure using
Code:
cnt = application.counta(MyCountRange,CriteriaValue)
OR...

just insert a new column that has a value of 1 for each row and inclued that SUM that to get the count. :)

Skip,

[glasses] [red]Be advised:[/red] When you ignite a firecracker in a bowl of vanilla, chocolate & strawberry ice cream, you get...
Neopolitan Blownapart! [tongue]


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top