title: Filter PowerPivot table using a cell reference
body: <p>So I've tried in vain to get the instructions from this <a href="https://stackoverflow.com/questions/19126266/how-to-update-powerpivot-pivot-table-filter-via-cell-reference">post</a> to work with my data.  I keep getting a run-time error 1004.  My goal is to input a company name into cell I1 of the same sheet as the pivot table and then have the pivot table filter by that entry.  Here's my adapted code:</p>
  
  <pre><code>Sub filtercompany()
      ' Filtercompany
      Dim FilterValue As String
      FilterValue = ActiveSheet.Range("I1").Value 'get value for filter
  
      ActiveSheet.PivotTables("PivotTable1") _
          .PivotFields("[Company].[Name].[Name]").ClearAllFilters
      ActiveSheet.PivotTables("PivotTable1").PivotFields("[Company].[Name].[Name]") _
          .CurrentPageName = "[Company].[Name].&amp;[" &amp; FilterValue &amp; "]"
  End Sub
  </code></pre>