How can I set PivotItem.Visible property to True?
What's wrong with the following codes? I can set visible=false but when I try to set it to true run I receive run time error
at "pi.visible = True"
Dim pi as pivotitem
sheets("pivot").select
For Each pi in ActiveSheet.PivotTables("Pivottable1").PivotFields ("fieldname").PivotItems
If pi.Visible = False Then
pi.Visible = True
End If
Next
|