W
Whitney Yiu
I am currently working with a Pivot Table. What i am trying to do is
determine if a Pivot Field is visible or not, and if it is, then i want to
make it hidden. To set a Pivot Field to hidden, i use the following code:
Set pf = pfs.Item("Sum of Actual")
MsgBox pf.Name
pf.Orientation = xlHidden
However, this appears to break if the Pivot Field "Sum fo Actual" is already
hidden. I get "Run-time error '1004': Unable to get the Item property of the
PivotFields class" error on the line that tries to set pf to the "Sum of
Actual" pivot field.
Does anyone have any ideas on what i can do to fix this?
Any help is GREATLY appreciated! Thanks
Whitney
determine if a Pivot Field is visible or not, and if it is, then i want to
make it hidden. To set a Pivot Field to hidden, i use the following code:
Set pf = pfs.Item("Sum of Actual")
MsgBox pf.Name
pf.Orientation = xlHidden
However, this appears to break if the Pivot Field "Sum fo Actual" is already
hidden. I get "Run-time error '1004': Unable to get the Item property of the
PivotFields class" error on the line that tries to set pf to the "Sum of
Actual" pivot field.
Does anyone have any ideas on what i can do to fix this?
Any help is GREATLY appreciated! Thanks
Whitney