I have this code but sometimes it may search for a data is not, so I want a IF THEN formula maybe if it doesnt found anything it can still work, or maybe IFERROR
Sub PivotTableFilter()
Dim MasterAcc As Variant
MasterAcc = Workbooks(Wk_Name).Worksheets("Draft").Range("C4").Value
With Workbooks(Wk_Name).Worksheets("Pivot Table I").PivotTables("PivotTable1")
.PivotFields("Master Account").ClearAllFilters
.PivotFields("Master Account").CurrentPage = MasterAcc
End With
End Sub
Sub PivotTableFilter()
Dim MasterAcc As Variant
MasterAcc = Workbooks(Wk_Name).Worksheets("Draft").Range("C4").Value
With Workbooks(Wk_Name).Worksheets("Pivot Table I").PivotTables("PivotTable1")
.PivotFields("Master Account").ClearAllFilters
.PivotFields("Master Account").CurrentPage = MasterAcc
End With
End Sub