Dear MrExcel,
I need to coloring textbox based on its value. I've tried to write the code below, but it wont works.
If value = 0% then backcolor is Red
If value > 0 and <= 50% then backcolor is Yellow
Else backcolor = Green
Can somebody help me?
Thank you
prima
I need to coloring textbox based on its value. I've tried to write the code below, but it wont works.
If value = 0% then backcolor is Red
If value > 0 and <= 50% then backcolor is Yellow
Else backcolor = Green
Can somebody help me?
Code:
Private Sub Train3_Progress_Change()
Train3_Progress.Value = Format(Train3_Progress.Value, "#0%")
On Error Resume Next
Select Case True
Case Train3_Progress.Value = 0
Train3_Progress.BackColor = vbRed
Case Train3_Progress.Value >= 0.1 And Train3_Progress.Value <= 0.5
Train3_Progress.BackColor = vbYellow
Case Train3_Progress.Value > 0.5
Train3_Progress.BackColor = vbGreen
End Select
End Sub
Thank you
prima