View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Looping through Looping through is offline
external usenet poster
 
Posts: 69
Default Pivottable filter

Is there a way to filter a pivot table list based on a cell range within the
sheet?

This is what I have

Sub Macro12()
With ActiveSheet.PivotTables("WON").PivotFields("Month Won")
.PivotItems("1").Visible = False
.PivotItems("2").Visible = False
.PivotItems("3").Visible = False
.PivotItems("4").Visible = False
.PivotItems("5").Visible = False
.PivotItems("6").Visible = False
.PivotItems("7").Visible = False
.PivotItems("8").Visible = False
.PivotItems("9").Visible = False
.PivotItems("10").Visible = False
.PivotItems("11").Visible = False
.PivotItems("12").Visible = True
.PivotItems("(blank)").Visible = False
End With
End Sub

In this paticular case I am hiding all the options except "12", which
happens to correspond with the current month we are in. Can I just have the
pivot table look at cell "A2" and filter out all the extra criteria in that
column except what is specified in cell "A2"?

Any help is greatly apprechiated.
Peter