change chart colors based on value?

stevelucky

Board Regular
Joined
Oct 6, 2006
Messages
126
I have a bar chart that I'd like to have change color based on the value. For example, the bar is gray until it reaches 30, and then it beomes green. any ideas?
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
The simplest way would be to write a macro that changed the color when it was above 30.

Code:
if thisworkbook.worksheets("data").cells(1,1) > 30 then
thisworkbook.worksheets("chartsheet").chartobjects("chartname").chart.seriescollection(1).forecolor.colorindex = 7
endif

Nice and easy to read.

Don't forget to include an "else" half of the statement that undoes the color change when it goes below 30.
 
Upvote 0
I am almost ashamed to admit it, but sometimes I will copy a graph and paste it into Paintbrush. I can edit colors and ad text and lines in it, if you zoom in you cna make it look pretty good.

Just a thought.
 
Upvote 0
well, that doesn't really help if it's a dynamic chart. if it were static and i didn't need it to be able to change that would be fine. and in that case, i could just change the chart color in excel. so, no, that doesn't quite help. thanks for trying though.
 
Upvote 0

Forum statistics

Threads
1,222,150
Messages
6,164,242
Members
451,882
Latest member
Bigtop

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