ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Code not working (https://www.excelbanter.com/excel-programming/301049-code-not-working.html)

Todd huttenstine

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

Frank Kabel

Code not working
 
Hi
see your other posts

--
Regards
Frank Kabel
Frankfurt, Germany


Todd Huttenstine wrote:
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



All times are GMT +1. The time now is 07:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com