Dynamic Pie Chart Slice Colours via VBA

mikeymay

Well-known Member
Joined
Jan 17, 2006
Messages
1,600
Office Version
  1. 365
Platform
  1. Windows
Is there a way of creating an array that will hold lists of RGB values based on a static list of possible slices in a pie chart in order to colour those slices based on the list?

E.g.

The full list of possible options and their colours - the cells would be coloured as per the list below
Option 1 - Red
Option 2 - Green
option 3 - Blue
Option 4 - Grey
Option 5 - Yellow

If a pie chart consists of
Option 1
Option 3
Option 5

How do I utilise an array to hold the full list of options and RBG values to then loop through each point in the pie chart and colour those slices?


TIA
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Thanks Derek, that looks exactly what I need!

I am looking at this part of the project next week so I'll pick it up then.


Thanks
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,739
Members
449,050
Latest member
excelknuckles

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