I have drop down which has a list of countries. I need the pivot table to be filtered based on the country selected on the drop down. I am using this code.
Sub PivotChange(ByVal Target As Range)
If Not Application.Intersect(Target, Sheets("Summary").Range("D7")) Is Nothing Then
Sheets("Data_4PivotChart").PivotTables("PivotTable7").PivotFields("Country"). _
ClearAllFilters
Sheets("Data_4PivotChart").PivotTables("PivotTable7").PivotFields("Country").CurrentPage _
= Sheets("Summary").Range("D7").Value
End If
End Sub
But currently its not doing anything. Can anyone help me where should I add this code so that it will be triggered by the event.
Thanks