I'm writing a macro to Pivot a ream of data into a tabulated form for easier reading.
Occasionally, the data subset will contain a "blank" entry that - while not a problem - I would rather not display in the Table (for clarity).
The following removes it:
With ActiveSheet.PivotTables("SortedTable").PivotFields("Message")
.PivotItems("(blank)").Visible = False
End With
But if the raw data happens to NOT contain any blanks, it fails with the message:
"Run-time error '1004':
Unable to get the PivotItems property of the PivotField class
Could someone advise the most elegant way of programming - "If there are no BLANK items then don't bother trying this"?
Thanks in advance.
Steve
Bookmarks