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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top