M
mcm52188
Hello,
I've created a macro that makes a pivot table from a certain data set. This
works except that sometimes the data set contains (blank) and (""). To
exclude these from the pivot table, I have this code in place..
With ActiveSheet.PivotTables("PivotTable1").PivotFields( _
"Consolidated Cost Center")
.PivotItems("").Visible = False
.PivotItems("(blank)").Visible = False
End With
However, sometimes the data set does not have any (blank) or (""), in which
case the macro will get this error,
Run-time error '1004':
Unable to get the PivotItems Property of the PivotField class
Is there a way to make the macro skip the code if there are no (blank) or
("")?
I am using Excel 2000.
Thanks in advance!
Marshall
I've created a macro that makes a pivot table from a certain data set. This
works except that sometimes the data set contains (blank) and (""). To
exclude these from the pivot table, I have this code in place..
With ActiveSheet.PivotTables("PivotTable1").PivotFields( _
"Consolidated Cost Center")
.PivotItems("").Visible = False
.PivotItems("(blank)").Visible = False
End With
However, sometimes the data set does not have any (blank) or (""), in which
case the macro will get this error,
Run-time error '1004':
Unable to get the PivotItems Property of the PivotField class
Is there a way to make the macro skip the code if there are no (blank) or
("")?
I am using Excel 2000.
Thanks in advance!
Marshall