View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Todd huttenstine Todd huttenstine is offline
external usenet poster
 
Posts: 260
Default Code not working

Hey guys

Code used to work, now doesnt since I made a change...

This code goes through each pivot field in the data sector
of a pivot table. It hides each pivotfield. Currently in
the below example, the value of variable "pvtfield"
is "Percent Overdue". I looked in the pivot table and
this is a pivotfield name(One I added manually which I
will explain in a minuye). The only difference this time
than before, is this time the field is a calculated field
(where I had to right click on the pivot table, select
formulas, and click calculated field). But I called it
the exact same name as I did before I did this.

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