Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pivot table - How do I clear drop down list contents?

Status
Not open for further replies.

roadrnr

Programmer
Dec 4, 2002
3
US
The problem I am experiencing is explained in Microsoft Knowledge Base Article - 316446.

I am trying to clear the contents of the drop down fields in multiple pivot tables within one file (each pivot table is on it's own worksheet).

We contacted MS for the fix, and this is what they gave us:
Sub Junk()
For Each itm In ActiveSheet.PivotTables(1).PivotFields("columnname").PivotItems
If itm.RecordCount = 0 Then itm.Delete
Next itm
End Sub

When I try to run this, I get an error that only says "400". Any ideas?
 
A dirty way...

rename the field in the source data,...

then refresh the pivot table...

then repeat the above steps, restoring the origional field name.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top