I have written a macro to create a pivottable...along the code I see this...

ActiveSheet.PivotTables("PivotTable1").AddDataField ActiveSheet.PivotTables( _
"PivotTable1").PivotFields("Dur(Sec)"), "Count of Dur(Sec)", xlCount
Range("A4").Select
With ActiveSheet.PivotTables("PivotTable1").PivotFields("Status")
.PivotItems("ANSWER").Visible = False
.PivotItems("BUSYOUT").Visible = False
.PivotItems("BREAK").Visible = False
.PivotItems("BREAK-MISSEDCALL").Visible = False
.PivotItems("BUSY").Visible = False
.PivotItems("LOGIN").Visible = False
.PivotItems("LOGOUT").Visible = False
.PivotItems("MISSEDCALL").Visible = False
.PivotItems("RING").Visible = False
.PivotItems("WAIT FOR CALL").Visible = False
.PivotItems("WRAPUP").Visible = False
End With

Everytime there is a new status in the worksheet, I have to include the status in the above code to hide the status. This is very inefficient. I like to know if I can default all status.visible to False and I can code to show only the status that I am interested. This way, whenever there is a new status, I dont have to change my macro.

And also. How do I know how many status are there in the PivotFields("Status")?

Thanks.