pivot table page field


Posted by hcir on February 04, 2001 3:20 PM

with vb, how can i get a list of all the values from a pivot tables page filed



Posted by Dave Hawley on February 04, 2001 5:11 PM

Hi hcir

This should do it:

Sub GetList()
Dim PField As PivotItem
Dim pt As PivotTable
Dim Rw As Integer

Set pt = Sheet1.PivotTables("PivotTable1")

For Each PField In pt.PageFields("head").PivotItems
Rw = Rw + 1
Cells(Rw, 4) = PField
Next

End Sub


Where "PivotTable1" is the name of the Pivot Table and "head" is the name of the page field.


Hope this helps

Dave


OzGrid Business Applications