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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to simplify the statements for removing PT subtotals? 1

Status
Not open for further replies.

feipezi

IS-IT--Management
Aug 10, 2006
316
US
Hi,

Any idea of how to make the following statements simple because they look quite stupid? There must be a way of doing it. No idea why repetitive "False" can help. I tried to cut down to 1 but failed.

Thanks in advance.


...
Activesheet.PivotTables(1).PivotFields("SP_NAME").Subtotals = Array(False, False, False, False, False, False, False, False, False, False, False, False)
...


 
Cuz each array element is significant!!!

Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
Custom subtotals allow multiselect, you can also set field's subtotals to "automatic" and "none".
The simplest way to remove subtotals with unknown settings and without testing and setting each item is to set it to "automatic" (removes custom settings) and next to "none":
[tt]With Activesheet.PivotTables(1).PivotFields("SP_NAME")
.Subtotals(1)=True
.Subtotals(1)=False
End With[/tt]
for known automatic setting:
[tt]Activesheet.PivotTables(1).PivotFields("SP_NAME").Subtotals(1)=False[/tt]
for known custom settings (here "count" only):
[tt]Activesheet.PivotTables(1).PivotFields("SP_NAME").Subtotals(3)=False[/tt]


combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top