Hi,
I have a macro that creates 2 pivot tables, both tables have some filtering set as follows, however, the values that I filter on do not always have any data.
With ActiveSheet.PivotTables(“PivotTable1”).PivotFields(“Underwriter”)
.PivotItems(“CP_FI BOM_Renewals”).Visible = False
.PivotItems(“GSSC_Processing”).Visible = False
My question is, that if the field does not contain either or both of the values, how do I stop the code from executing? If I leave it as is, and then one &/or both of the field values don’t exist then the macro stops in debug mode and I have to change the line focus and continue with CTRL-F9 & F5. As I am going on annual leave shortly, I would prefer the macro to not go into debug mode to make it easier for whoever is running the code in my absence.