How to show or hide categories on an Excel Pie chart using VBA

ddfarren

New Member
Joined
May 8, 2018
Messages
1
I've spent hours researching this question with no results and the Excel object model posted in MSDN has not been any help. I have an Excel spreadsheet with a prebuilt pie chart that is opened by Access and manipulated via VBA. The data to be displayed is populated and the resulting chart is used in an Access report. I did not build the original spreadsheet but I've modified it for my own use. A user pointed out that one of the categories was missing. Right-clicking on the chart and clicking on "select data" brings up the "Select Data Source" dialog box. The categories are listed on the right-hand side. Several were unchecked. I've manually selected them all and now the chart is correct.

The question is: I might want to unselect and (more importantly) re-select one of these categories using VBA code. Can this be done and if so, how? Just point me in the right direction and I'll figure out the rest.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Forum statistics

Threads
1,214,878
Messages
6,122,062
Members
449,064
Latest member
scottdog129

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top