Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Removing Field Subtotals except for 2 from from PivotTable

Please assist

I have the following code to remove the field subtotals except for 2 from
pivot:

for Each pf In ActiveSheet.PivotTables("PivotTable2").PivotFields
If pf.Name = "field1" Or pf.Name = "field2" Then Exit For

pf.Subtotals = Array(False, False, False, False, False, False,
False, False, False, False, False, False)
Next

This code removes all subtotals; however, I want subtotals of the first 2
fields.

Thanks
Gwen
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Removing Field Subtotals except for 2 from from PivotTable

for Each pf In ActiveSheet.PivotTables("PivotTable2").PivotFields

If pf.Name < "field1" and pf.Name < "field2" Then r

pf.Subtotals = Array(False, False, False, False, False, False,
False, False, False, False, False, False)

End if

Next

--
Regards,
Tom Ogilvy



"Gwen" wrote:

Please assist

I have the following code to remove the field subtotals except for 2 from
pivot:

for Each pf In ActiveSheet.PivotTables("PivotTable2").PivotFields
If pf.Name = "field1" Or pf.Name = "field2" Then Exit For

pf.Subtotals = Array(False, False, False, False, False, False,
False, False, False, False, False, False)
Next

This code removes all subtotals; however, I want subtotals of the first 2
fields.

Thanks
Gwen

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Removing Field Subtotals except for 2 from from PivotTable

Thank you.

"Tom Ogilvy" wrote:

for Each pf In ActiveSheet.PivotTables("PivotTable2").PivotFields

If pf.Name < "field1" and pf.Name < "field2" Then r

pf.Subtotals = Array(False, False, False, False, False, False,
False, False, False, False, False, False)

End if

Next

--
Regards,
Tom Ogilvy



"Gwen" wrote:

Please assist

I have the following code to remove the field subtotals except for 2 from
pivot:

for Each pf In ActiveSheet.PivotTables("PivotTable2").PivotFields
If pf.Name = "field1" Or pf.Name = "field2" Then Exit For

pf.Subtotals = Array(False, False, False, False, False, False,
False, False, False, False, False, False)
Next

This code removes all subtotals; however, I want subtotals of the first 2
fields.

Thanks
Gwen

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
Why are some subtotals missing from my pivottable? debbie.b Excel Discussion (Misc queries) 0 August 17th 07 02:05 AM
Using a field name in an IF function for a calculated field in a PivotTable Joel P Excel Worksheet Functions 0 March 29th 07 12:48 AM
PivotTable Automatic Subtotals Monica Hall Excel Discussion (Misc queries) 0 January 10th 06 01:04 AM
PivotTable - PivotTable Field name is not valid - error! miker1999[_17_] Excel Programming 1 June 10th 04 10:30 AM
Help! Turning off PivotTable Subtotals Jim[_17_] Excel Programming 0 July 30th 03 04:59 PM


All times are GMT +1. The time now is 10:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"