Change progress bar color based on result
MARJ
-
Exceltutofr -
Exceltutofr -
Hello,
I successfully installed a progress bar in my Excel table cell using conditional formatting.
So I have a bar that progresses according to whether my result is 40 out of 100 or 75 out of 100, etc.
But I would also like this bar to be red when my result ranges between 0 and 50. Then, it should turn green when the result rises between 51 and 100.
How can I do that?
Thanks to anyone who can help me and have a great day,
Configuration: Windows / Chrome 51.0.2704.103
I successfully installed a progress bar in my Excel table cell using conditional formatting.
So I have a bar that progresses according to whether my result is 40 out of 100 or 75 out of 100, etc.
But I would also like this bar to be red when my result ranges between 0 and 50. Then, it should turn green when the result rises between 51 and 100.
How can I do that?
Thanks to anyone who can help me and have a great day,
Configuration: Windows / Chrome 51.0.2704.103
2 réponses
Hello
I don't think it's possible (-but I don't know everything); All we can imagine is a "neutral" color bar with a complementary conditional formatting where the base cell background is red that turns green if the value <50, (or one conditional formatting for green and one for red) but that will only allow spotting the cells below and above average without changing the color of the bar.
Best regards
The quality of the response mainly depends on the clarity of the question, thank you!
I don't think it's possible (-but I don't know everything); All we can imagine is a "neutral" color bar with a complementary conditional formatting where the base cell background is red that turns green if the value <50, (or one conditional formatting for green and one for red) but that will only allow spotting the cells below and above average without changing the color of the bar.
Best regards
The quality of the response mainly depends on the clarity of the question, thank you!
Hello,
it's possible but in VBA, example to process the range A2:A50
right-click on the tab of your sheet/View code, paste this code
--
Best regards
Mike-31
A period of failure is a perfect time to sow the seeds of knowledge.
it's possible but in VBA, example to process the range A2:A50
right-click on the tab of your sheet/View code, paste this code
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("A2:A50")) Is Nothing Then
Target.FormatConditions.AddDatabar
With Target.FormatConditions(1)
.MinPoint.Modify newtype:=xlConditionValueNumber, newvalue:=0
.MaxPoint.Modify newtype:=xlConditionValueNumber, newvalue:=100
Select Case Target.Value
Case 0 To 50
.BarColor.Color = vbRed
Case 51 To 100
.BarColor.Color = vbGreen
End Select
End With
End If
End Sub
--
Best regards
Mike-31
A period of failure is a perfect time to sow the seeds of knowledge.