ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Subtotal(s) range in Pivot Tables. Is it Missing? (https://www.excelbanter.com/excel-programming/330480-subtotal-s-range-pivot-tables-missing.html)

marwan

Subtotal(s) range in Pivot Tables. Is it Missing?
 
Many specific ranges in the PivotTable object (and the relevant
objects) are specified such as the DataBodyRange ,DataLabelRange
,TableRange1 and

TableRange2 for the Pivot Table Object and DataRange,LabelRange for the
PivotField and PivotItem Objects.
The problem is that I searched the Object Model for a property of the
PivotField or PivotTable objects that represents the Subtotal(s) range
for a specific PivotField but I couldn't find such a property.
The only way I found to refer to a subtotal range (If Exists) of a
pivot field is to "select it" using the PivotSelect method of the
PivotTable object.
But as we learned it is not a good idea to select a range to do
something with it (give it a specific format for example) unless we
certainly want to select it.
What is the best way to handle the Subtotal range of a PivotField?
Thanks.


Debra Dalgleish

Subtotal(s) range in Pivot Tables. Is it Missing?
 
As far as I know, that's the only way to work with the subtotal ranges.

If you turn off screen updating at the start of the code, and return to
the active cell after formatting, users shouldn't notice much negative
impact.

marwan wrote:
Many specific ranges in the PivotTable object (and the relevant
objects) are specified such as the DataBodyRange ,DataLabelRange
,TableRange1 and

TableRange2 for the Pivot Table Object and DataRange,LabelRange for the
PivotField and PivotItem Objects.
The problem is that I searched the Object Model for a property of the
PivotField or PivotTable objects that represents the Subtotal(s) range
for a specific PivotField but I couldn't find such a property.
The only way I found to refer to a subtotal range (If Exists) of a
pivot field is to "select it" using the PivotSelect method of the
PivotTable object.
But as we learned it is not a good idea to select a range to do
something with it (give it a specific format for example) unless we
certainly want to select it.
What is the best way to handle the Subtotal range of a PivotField?
Thanks.



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



All times are GMT +1. The time now is 12:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com