Change Font color based on vaue

  • Thread starter Thread starter Patrick C. Simonds
  • Start date Start date
P

Patrick C. Simonds

How can I change this, so that if the number is negative the result in the
TextBox is red with a preceding - sign?

VacationTaken.TextBox504.Value = rng(1, 6).Value - CDbl("0" &
VacationTaken.TextBox503.Value)
VacationTaken.TextBox504.Text = Format(VacationTaken.TextBox504.Text,
"0.0000")
 
Try this after what you posted...

If VacationTaken.TextBox504.Value < 0 Then
VacationTaken.TextBox504.ForeColor = vbRed
End If
 
Back
Top