Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel PivotChart Field Buttons

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).
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 342
Default 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).

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel PivotChart Field Buttons

Thanks Tom - this was very helpful.

"TomPl" wrote:

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).

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where did the "Hide PivotChart field buttons" function go in 2007? Bony Pony[_2_] Excel Discussion (Misc queries) 3 December 12th 08 07:04 PM
Create a total field for a pivot table/pivotchart rock3775 Excel Discussion (Misc queries) 1 August 31st 06 05:15 PM
pivot chart is it possible to hide individual field buttons? Layout Field buttons Matt Charts and Charting in Excel 0 August 27th 06 02:57 PM
Excel Pivot chart - Scales of multiple field buttons Ali Excel Discussion (Misc queries) 0 May 4th 06 01:20 PM
PivotChart Data Field - can it be value? pajordan Charts and Charting in Excel 1 March 12th 05 04:29 AM


All times are GMT +1. The time now is 10:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"