T
Todd Huttenstine
Why will it not let me use any of the below methods to
hide pivotfield "Percent Overdue"? When I take
pivotfield "Percent Overdue" out of the pivottable before
I run the codes, they all work fine. When I specify to
remove another pivotfield with another name, the codes
work fine. I even recorded a macro when I removed
pivotfield "Percent Overdue" and then copied that macro
and put it in a commandbutton. When I ran it, I got the
same error. The last code is the macro code. I get the
error "Run-time error '1004':
Unable to get the PivotFields property of the PivotTable
class"
Now the only difference in this pivotfield "Percent
Overdue" is I created it manually from right clicking on
the Pivot Table and selecting Formulas and then
calculatedField. I also happen to notice that when I right
click on the pivottable and then select wizard and layout
and then double click pivotfield "Percent Overdue" that
all the options in the summarize listbox are greyed out
where I cannot select any of them. On all the other
pivotfields I can change them. But I assume this is
normal because the created calculated field has its own
formula in it.
Please help.
Set pvttable = Worksheets("Reps Current").PivotTables
("PivotTable1")
For Each pvtfield In pvttable.DataFields
pvtfield.Orientation = xlHidden
Next pvtfield
OR
Worksheets("Reps Current").PivotTables
("PivotTable1").PivotFields.Item("Percent
Overdue").Orientation = xlHidden
OR
Worksheets("Reps Current").PivotTables
("PivotTable1").PivotFields("Percent Overdue").Orientation
= xlHidden
OR
ActiveSheet.PivotTables("PivotTable1").PivotFields
("Percent Overdue"). _
Orientation = xlHidden
hide pivotfield "Percent Overdue"? When I take
pivotfield "Percent Overdue" out of the pivottable before
I run the codes, they all work fine. When I specify to
remove another pivotfield with another name, the codes
work fine. I even recorded a macro when I removed
pivotfield "Percent Overdue" and then copied that macro
and put it in a commandbutton. When I ran it, I got the
same error. The last code is the macro code. I get the
error "Run-time error '1004':
Unable to get the PivotFields property of the PivotTable
class"
Now the only difference in this pivotfield "Percent
Overdue" is I created it manually from right clicking on
the Pivot Table and selecting Formulas and then
calculatedField. I also happen to notice that when I right
click on the pivottable and then select wizard and layout
and then double click pivotfield "Percent Overdue" that
all the options in the summarize listbox are greyed out
where I cannot select any of them. On all the other
pivotfields I can change them. But I assume this is
normal because the created calculated field has its own
formula in it.
Please help.
Set pvttable = Worksheets("Reps Current").PivotTables
("PivotTable1")
For Each pvtfield In pvttable.DataFields
pvtfield.Orientation = xlHidden
Next pvtfield
OR
Worksheets("Reps Current").PivotTables
("PivotTable1").PivotFields.Item("Percent
Overdue").Orientation = xlHidden
OR
Worksheets("Reps Current").PivotTables
("PivotTable1").PivotFields("Percent Overdue").Orientation
= xlHidden
OR
ActiveSheet.PivotTables("PivotTable1").PivotFields
("Percent Overdue"). _
Orientation = xlHidden