Change Font color based on vaue

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")
 
R

Rick Rothstein

Try this after what you posted...

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