View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Hiding a pivotfield using code

Remove it from the data section.

--
Regards,
Tom Ogilvy

"Todd Huttenstine" wrote in message
...
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