Excel PivotChart Field Buttons
You can disable the field button on a pivot chart by disabling
the itemselection property of the field in the underlying
pivot table. This can be accomplished with code similar to
what follows.
Hiding the button on the pivot chart is a different matter.
I don't know how to hide one button without hiding all.
Sub DisablePivotField()
Dim wks As String
Dim pvt As String
Dim fld As String
wks = "2007Pivot"
pvt = "PivotTable2"
fld = "BusUnit"
Worksheets(wks).PivotTables(pvt).PivotFields(fld). EnableItemSelection = False
End Sub
Luck to you.
"gmead7" wrote:
I am using Excel 2003. I have a PivotChart with 3 Field Buttons. I want the
user to be able to work with one of the field buttons and I want disable (and
preferably make invisible) the other 2 field buttons. I suspect I may have
to do this through VBA, but haven't been able to find a way to do this yet.
I haven't been able to figure out how to reference the field buttons within
VBA either. I am pre-novice in regards to VBA so I really need the "for
dummies" version (please, be gentle).
|