View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gwen Gwen is offline
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