dversloot1
Board Regular
- Joined
- Apr 3, 2013
- Messages
- 113
Hello,
I'm wondering if there is a way to change the report filter in a pivot table to reference a cell in a worksheet.
I recorded a macro and made slight alterations to get the code below.
Sub ptDate()
Dim pt As PivotTable
Set pt = Sheets("DrilledDown").PivotTables("PivotTable1")
pt.PivotFields("[Transaction Source].[Distributor].[Distributor]").ClearAllFilters
pt.PivotFields("[Transaction Source].[Distributor].[Distributor]").CurrentPage = CStr(Range("B7"))
End Sub
Could this be happening because it is a pivot table running off an OLAP connection?
Dan
I'm wondering if there is a way to change the report filter in a pivot table to reference a cell in a worksheet.
I recorded a macro and made slight alterations to get the code below.
Sub ptDate()
Dim pt As PivotTable
Set pt = Sheets("DrilledDown").PivotTables("PivotTable1")
pt.PivotFields("[Transaction Source].[Distributor].[Distributor]").ClearAllFilters
pt.PivotFields("[Transaction Source].[Distributor].[Distributor]").CurrentPage = CStr(Range("B7"))
End Sub
Could this be happening because it is a pivot table running off an OLAP connection?
Dan