Hiding a pivotfield using code

T

Todd Huttenstine

Using VBA code, how would I hide the pivotfield by the
name of "Test" which located in the Data section of the
pivot table?


Set PvtTable = Worksheets("Reps Current").PivotTables
("PivotTable1")
For Each pvtfield In PvtTable.DataFields
pvtfield.Orientation = xlHidden
Next pvtfield

Thank you
Todd Huttenstine
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top