Anastasiia
New Member
- Joined
- Oct 31, 2016
- Messages
- 1
Hello, thanks a lot for this forum, I have found a lot of answers on this one.
However, now I am so stuck with one question as what I've found so far does not work, and I really need your help.
I have a PivotTable2, the filter of which I want to link to a cell value (C1).
The cell value itself is extracted from the slicer connected to another pivot table from a different data source.
I want the filter of a PivotTable2 to be changed automatically when the value in a cell C1 changes.
Here's the macro that I recorded, so it would be probably easier to start with:
Sub Change_Pivot_Table_Filter()
'
' Change_Pivot_Table_Filter Macro
'
'
Range("C59").Select
ActiveSheet.PivotTables("PivotTable2").PivotFields("delivery_date"). _
CurrentPage = "(All)"
With ActiveSheet.PivotTables("PivotTable2").PivotFields("delivery_date")
.PivotItems("10/21/2016").Visible = False
.PivotItems("10/23/2016").Visible = True
End With
End Sub
Will be super thankful for ideas!
However, now I am so stuck with one question as what I've found so far does not work, and I really need your help.
I have a PivotTable2, the filter of which I want to link to a cell value (C1).
The cell value itself is extracted from the slicer connected to another pivot table from a different data source.
I want the filter of a PivotTable2 to be changed automatically when the value in a cell C1 changes.
Here's the macro that I recorded, so it would be probably easier to start with:
Sub Change_Pivot_Table_Filter()
'
' Change_Pivot_Table_Filter Macro
'
'
Range("C59").Select
ActiveSheet.PivotTables("PivotTable2").PivotFields("delivery_date"). _
CurrentPage = "(All)"
With ActiveSheet.PivotTables("PivotTable2").PivotFields("delivery_date")
.PivotItems("10/21/2016").Visible = False
.PivotItems("10/23/2016").Visible = True
End With
End Sub
Will be super thankful for ideas!