Linking PivotTable filter to a cell

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!
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,216,216
Messages
6,129,566
Members
449,517
Latest member
Lsmich

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top