anaiscarrasco
New Member
- Joined
- Aug 12, 2019
- Messages
- 1
Hi, I need help to filter my pivot table by cell value being less or equal to. this is what I have
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Range("I12:J12")) Is Nothing Then Exit Sub
Dim pt As PivotTable
Dim Field As PivotField
Dim NewCat As String
Set pt = Worksheets("Swap_Table_EU").PivotTables("PivotTable2")
Set Field = pt.PivotFields("ASP + 20")
NewCat = Worksheets("Swap_Table_EU").Range("<=J12").Value
Field.ClearAllFilters
Field.CurrentPage = NewCat
pt.RefreshTable
End With
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Range("I12:J12")) Is Nothing Then Exit Sub
Dim pt As PivotTable
Dim Field As PivotField
Dim NewCat As String
Set pt = Worksheets("Swap_Table_EU").PivotTables("PivotTable2")
Set Field = pt.PivotFields("ASP + 20")
NewCat = Worksheets("Swap_Table_EU").Range("<=J12").Value
Field.ClearAllFilters
Field.CurrentPage = NewCat
pt.RefreshTable
End With
End Sub