hidden versus visible in pivot tables

I am trying to determine the number of rows and columns that are viewable in a pivottable. As the source data changes, new values will be displayed so the dimensions of the table range will change. Is there a quick way to get the viewable rows and columns

My objective is to define a chart using the internal datarange of the pivot table and by-pass the autoPivotChart behavior in order to retain control over the structure and format of the chart.

Note: this is not the same as visible as when you restrict the pivottable using a Page value, not all potential items will be viewable but their pivotitem.visible property will be true.



Answer this question

hidden versus visible in pivot tables

  • Rhubarb

    Solved. I did some more research of the object model and found the address property of the Range object. This will return the dimensions of the pivot table in R1C1:R1C1 notation by using the pivottable.databodyrange.address. This property was not visible in the watch window of VBA so initially I was not aware of the property.

    The returned range also brings back the Grand total row and column which I do not need, but is the information I need to determine the chart range that I want to use.


  • hidden versus visible in pivot tables