Pivot table filter field entries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a pivot table with several page fields. Now I want all other fields to adapt when I make a selection in one field so that only relevant selection possibilities are shown. For example, if I have a list of employees with the fields sex and name and choose sex:female then I only want to be able to choose names of females. Can anyone help me out on this?
 
Is it possible to achieve this effect with a macro? My suggestion would be:

Private Sub Worksheet_Change(ByVal Target As Range
If Target.Address = "$B$1" Then Application.EnableEvents = Fals
Worksheets(1).PivotTables(1).PivotCache.Refres
Application.EnableEvents = Tru
End I
End Su

My problem is: how do I connect the macro to the worksheet? How do I tell Excel that I want this macro to be executed each time cell b1 is changed in worksheet 1?
 
Back
Top