Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Range("F1:F2")) Is Nothing Then Exit Sub
'Set the Variables to be used
Dim pt As PivotTable
Dim Field As PivotField
Dim NewCat As String
'Here you amend to suit your data
Set pt = Worksheets("New Deals").PivotTables("NewDealsPivot")
Set Field = pt.PivotFields("Trade Date")
NewCat = Worksheets("New Deals").Range("F1").Value
'This updates and refreshes the PIVOT table
With pt
Field.ClearAllFilters
Field.CurrentPage = NewCat
pt.RefreshTable
End With
End Sub
Bookmarks