Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default remove subtotals from pivot tables

I am trying to generate a pivot table from a set of data but I want to be
able to run this at any time so the obvious solution would be a macro. I
recorded the macro and checked the radio button for subtotals = none which
brought up the following code:
ActiveSheet.PivotTables("PivotTable5").PivotFields ("Charge Week").Subtotals
= Array(False, False, False, False, False, False, False, False, False, False,
False, False)

Is there a better way of doing this other than an array such as Subtotals=
none or something like that as I assume that the array will alter depending
on certain criteria?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default remove subtotals from pivot tables

Why not check out the subtotals property in help:

Returns or sets subtotals displayed with the specified field. Valid only for
nondata fields. Read/write Variant.

expression.Subtotals(Index)

expression Required. An expression that returns a PivotField object.

Index Optional Variant. A subtotal index, as shown in the following
table. If this argument is omitted, the Subtotals method returns an array
that contains a Boolean value for each subtotal.

Index Meaning
1 Automatic
2 Sum
3 Count
4 Average
5 Max
6 Min
7 Product
8 Count Nums
9 StdDev
10 StdDevp
11 Var
12 Varp


If an index is True, the field shows that subtotal. If index 1 (Automatic)
is True, all other values are set to False.

---------------------------------------------------



So setting everything to false is the way to indicate none.



So I wouldn't see an easier way to do it.

--

Regards,

Tom Ogilvy



"ChristinaC" wrote in message
...
I am trying to generate a pivot table from a set of data but I want to be
able to run this at any time so the obvious solution would be a macro. I
recorded the macro and checked the radio button for subtotals = none which
brought up the following code:
ActiveSheet.PivotTables("PivotTable5").PivotFields ("Charge

Week").Subtotals
= Array(False, False, False, False, False, False, False, False, False,

False,
False, False)

Is there a better way of doing this other than an array such as Subtotals=
none or something like that as I assume that the array will alter

depending
on certain criteria?



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
Percentages of Subtotals for Pivot Tables Craig Excel Discussion (Misc queries) 2 July 26th 08 07:32 PM
Formulas using Subtotals in Pivot Tables Danie Excel Discussion (Misc queries) 0 September 11th 07 01:42 PM
Subtotals in Pivot Tables Fred Smith Excel Worksheet Functions 3 February 23rd 07 02:19 AM
add option in pivot tables to remove subtotals for fields epsoanalyst Excel Worksheet Functions 1 February 16th 06 09:26 PM
Pivot Tables- Total the Subtotals? Irenerz Excel Worksheet Functions 1 June 14th 05 07:19 PM


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