title: Linking A PivotTable filter to a cell
body: <p>I know that similar questions have been asked multiple times, but the solutions I have found and adjusted to suit my needs do not seems to work, so I would really appreciate any help.</p>
  
  <p>My issue is that 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.</p>
  
  <p>Here's the macro that I recorded, so it would be probably easier to start with:</p>
  
  <pre><code>    Sub Change_Pivot_Table_Filter()
  
      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
  </code></pre>
  
  <p>Thanks a lot!</p>