View Full Version : Pivot Table Settings

09-27-2007, 01:47 AM
I use getpivotdata to return information onto another sheet.
I was wondering, is it possible to use vba in a comment to show the pivot table settings:
ie what selection (filters) the fields are set to:

09-28-2007, 01:51 AM
I'm using the below to return the current field value. I'm not sure if it's applicable your case but here goes:

Dim TargetPage as PivotField
Dim SelectedValue As String

Set TargetPage = ActiveSheet.PivotTables("PivotMain").PivotFields("Quantity")
SelectedValue = TargetPage.CurrentPage.Value
The pivot table that I use is named PivotMain and has a page field named Quantity.