Hi
This is the VBA code I have (which I found here http://stackoverflow.com/questions/1...ue-into-a-cell) to filter a pivot table based on the value of a cell using data validation.
Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Set rng = Me.Range("MonthSelect")
If Not Application.Intersect(Target, rng) Is Nothing Then
With Sheets("Dashboard").PivotTables("PivotTable1").PivotFields("Month")
.ClearAllFilters
If Len(rng.Value) > 0 Then .CurrentPage = rng.Value
End With
End If
End Sub
What I want to be able to do is combine it with the below so I can filter by two different criteria.
Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Set rng = Me.Range("ContractSelect")
If Not Application.Intersect(Target, rng) Is Nothing Then
With Sheets("Dashboard").PivotTables("PivotTable1").PivotFields("Contract")
.ClearAllFilters
If Len(rng.Value) > 0 Then .CurrentPage = rng.Value
End With
End If
End Sub
Any help would be appreciated.
Bookmarks