So I've tried in vain to get the instructions from this post 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:
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].&[" & FilterValue & "]"
End Sub