Red background textbox if negative
Solved
surplus
Posted messages
673
Registration date
Status
Member
Last intervention
-
surplus Posted messages 673 Registration date Status Member Last intervention -
surplus Posted messages 673 Registration date Status Member Last intervention -
Hello,
I would like to set the background of a textbox to red if the value is negative
I tried this formula unsuccessfully
sit_compte = Format(sit_compte, "#,##0.00_ ;[Red]-#,##0.00"" €")
how should I proceed, I have been looking for an hour and I am stuck
thank you for your help
--
Best regards, see you soon
Surplus
I would like to set the background of a textbox to red if the value is negative
I tried this formula unsuccessfully
sit_compte = Format(sit_compte, "#,##0.00_ ;[Red]-#,##0.00"" €")
how should I proceed, I have been looking for an hour and I am stuck
thank you for your help
--
Best regards, see you soon
Surplus
3 answers
-
Hello forum, surplus
It can be done with a "class module"
A+ -
Hello,
Try with this event procedurePrivate Sub TextBox1_Change()
See you!
If TextBox1.Value < 0 Then
TextBox1.BackColor = RGB(255, 0, 0)
Else
TextBox1.BackColor = RGB(255, 255, 255)
End If
End Sub -
Hello
it's perfect
thank you very much
I hadn't thought of that solution
Best regards See you soon
Surplus