Use macro to change slice color on multiple charts

Whiskjack

New Member
Joined
Jul 15, 2017
Messages
2
Hi there.

I don't have much experience with Excel, but I've been trying to find a way to automate a tedious/time consuming task.

I currently have 9 donut charts each representing a clock. I have each chart broken down into 24 slices to indicate hours per day. I'd need to keep these slices at a fixed size. Each hour of those clocks is coloured based on a value in the table. I'd like to use a macro to change the colour of each slice depending on the value.

I tried my hand at a macro but I was doing one slice per clock at a time, meaning there would be a very large macro for what looks like a simple requirement . (IF RANGE("C3") = 0 THEN ...color white... ELSEIF RANGE("C3") = 1 THEN ... color red ..., just a complicated mess by the end) I hope there's a much more efficient way to do it, and allow for the addition or removal of charts.

Am I overcomplicating this? Is there something I can read up on that might steer me in the right direction?


Here's what I'd like it to look like:

http://i.imgur.com/UPanvTG.png

I appreciate any help!
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,215,045
Messages
6,122,840
Members
449,096
Latest member
Erald

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