Question: I cannot find a way to change the color of an Excel data bar based on value. Current formatting options only permit different colors based on positive/negative values. I'm currently using Excel 2010.

I would like to have the color of a data bar show up as 'red' if the value if between 0-0.3, 'yellow' if the value is between 0.3-0.6, and 'green' if the value if between >0.6.

Would really appreciate any info people could share.

Thanks,

TB

Answer: 
I setup conditional formatting in the cell adjacent to the data bar that changes color based on the value in the target cell (green, yellow, red, orange). I then loop through the VBA below to update the data bar color based on the conditional formatting in the adjacent cell.

```
Dim intCount As Integer
Dim db As DataBar

On Error Resume Next
For intCount = 9 To 43 'rows with data bars to be updated
    Worksheets("Worksheet Name").Cells(intCount, 10).FormatConditions(1).BarColor.Color = Worksheets("Worksheet Name").Cells(intCount, 11).DisplayFormat.Interior.Color
Next intCount

```
In your case, highlight the cell will be more suitable as we can not form data bar with multiple colors   

Conditional Formationg >Manage Rules...>New Rule   

Under Select a Rule Type, choose "Use a formula to determince which cells to format" and set your rules there  
![enter image description here](https://i.stack.imgur.com/agnr2.png)