I have created a userform to pull data from a spreadsheet and then assign the text box a color of green, yellow or red. It works fine until I try to format the text box to percentage then it will always show as green. Is there away for the conditional format to work correctly with percentages? Here is the code I am using:
Private Sub TextBox18_Change()
If TextBox18.Value > 0.98 Then
TextBox18.BackColor = vbGreen
ElseIf TextBox18.Value < 0.95 Then
TextBox18.BackColor = vbRed
Else
TextBox18.BackColor = vbYellow
End If
TextBox18.Text = Format(TextBox18.Text, "0.00")
End Sub
Any suggestions would be greatly appreciated. Thanks for your time!
Bookmarks