There was an odd condition that wasn't allowed for in the code
In the code there was a filter for (blank) Product Groups, but in the data there was no Blanks, which caused the error
So I added an error check that just goes to the next line if there is an error and all fixed
see attached file:
In the code there was a filter for (blank) Product Groups, but in the data there was no Blanks, which caused the error
So I added an error check that just goes to the next line if there is an error and all fixed
Code:
On Error Resume Next ' This is the new line
With ActiveSheet.PivotTables("PivotTable1").PivotFields("PRODUCT GROUP")
.PivotItems("(blank)").Visible = False
see attached file: