Hi,

I'm new to VBA and trying to manipulate a report filter to another cell in a separate sheet. The cell in the separate sheet is a text value. I'm also using a public OLAP cube as my source for my pivot table. I've been using this code so far:
[Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Range("D3:D5")) Is Nothing Then Exit Sub

Dim pt As PivotTable
Dim Field As PivotField
Dim NewCat As String


Set pt = Worksheets("Matrix").PivotTables("PivotTable2")
Set Field = pt.PivotFields("Sector")
NewCat = Worksheets("Control_sheet").Range("D3").Value

With pt
Field.ClearAllFilters
Field.CurrentPage = NewCat
pt.RefreshTable
End With

End Sub

The error code " Run time error 1004 - unable to get pivotfields property". I've tried a few codes but nothing seems to work.

All help would be greatly appreciated.

Thanks