Good day all,
VBA stops running and gives me an error 1004 message at the CurrentPage statement on the code.
What I am attempting to do here is to be able to filter the type report filter from a separate page, so this is just the set up for that getting cell d2 and cell e2 to filter the pivot table. I am using these two cell so that if I what to see shop 1 and 2 data at the same time I can do that.
Please help.
With WW
Field.ClearAllFilters
Field.CurrentPage = Qa
Field.CurrentPage = Sec
WW.RefreshTable
End With
End Sub
VBA stops running and gives me an error 1004 message at the CurrentPage statement on the code.
What I am attempting to do here is to be able to filter the type report filter from a separate page, so this is just the set up for that getting cell d2 and cell e2 to filter the pivot table. I am using these two cell so that if I what to see shop 1 and 2 data at the same time I can do that.
Please help.
Code:
If Intersect(Target, Range("d2", "e2")) Is Nothing Then Exit Sub
Dim WW As PivotTable
Dim Field As PivotField
Dim Qa As String
Dim Sec As String
Set WW = Worksheets("NFIFILTER").PivotTables("PivotTableN")
Set Field = WW.PivotFields("Type")
Qa = Worksheets("NFIFILTER").Range("d2").Value
Sec = Worksheets("NFIFILTER").Range("e2").Value
With WW
Field.ClearAllFilters
Field.CurrentPage = Qa
Field.CurrentPage = Sec
WW.RefreshTable
End With
End Sub
With WW
Field.ClearAllFilters
Field.CurrentPage = Qa
Field.CurrentPage = Sec
WW.RefreshTable
End With
End Sub