I am not quite sure where you are heading with the question but I think you
should be using the the ColumnRange property of a pivottable. Below is a way
to list all the columns in the pivot table range. Note that there are title
and Pivot value rows.
Sub PrintPivotLabels
Dim c As Object
Debug.Print "There are " &
ActiveSheet.PivotTables(1).ColumnRange.Cells.Count & " Columns"
For Each c In ActiveSheet.PivotTables(1).ColumnRange
Debug.Print c.Address & ":" & c.Value
next C
End Sub
Good Luck
--
Stewart Rogers
DataSort Software, L.C.
|