Seeking method to change bar chart data point color based on value

auto.pilot

Well-known Member
Joined
Sep 27, 2007
Messages
717
Using XL 2010, I am able to format a bar chart data series with two different colors if some of the values are negative. Checking the 'Invert if negative' box allows me to choose colors for positive and negative values. Ideally, I'd like to create bar charts that are two colors with a qualifier other than positive/negative. i.e.: Green bar if data point is equal to or greater than 10 and red if data point is below 10. Is there any way to do this?

Thanks

Jim
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

Worf

Well-known Member
Joined
Oct 30, 2011
Messages
4,129
Hello Jim


I suppose you already discovered how to do it:

VBA Code:
Sub Jim()
Dim arr, i%, p As Point
arr = ActiveChart.FullSeriesCollection(1).Values
For i = LBound(arr) To UBound(arr)
    Set p = ActiveChart.FullSeriesCollection(1).Points(i)
    Select Case arr(i) > 10
        Case True
            p.Format.Fill.ForeColor.RGB = RGB(10, 250, 10)
        Case False
            p.Format.Fill.ForeColor.RGB = RGB(250, 10, 10)
    End Select
Next
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,129,297
Messages
5,635,380
Members
416,856
Latest member
silentir

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
Top