Help with macro

M

Mike W

I have the following macro which hides the "blank" field in the pivot table
but only works when there is data in the Pivot field, if there is not I get
an error. What I need is an IF statement to accomodate this possibility.
Help would be much appreciated.

thanks,

Mike


With ActiveSheet.PivotTables("INDUSTRIAL").PivotFields("INTERNAL ORDER
No:")
.PivotItems("(blank)").Visible = False
End With
With ActiveSheet.PivotTables("RETAIL").PivotFields("INTERNAL ORDER No:")
.PivotItems("(blank)").Visible = False
End With
With ActiveSheet.PivotTables("WAL").PivotFields("INTERNAL ORDER No:")
.PivotItems("(blank)").Visible = False
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top