I search for way to solve this problem . what I want if the value in textbox2 less than value in textbox4 then the value in textbox5 should be positive .
the textboxes are existed on userform .
I have this but this doesn't give me positive value
any idea experts ,please?
the textboxes are existed on userform .
I have this but this doesn't give me positive value
VBA Code:
Private Sub TextBox2_AfterUpdate()
TextBox2.Value = Format(TextBox2.Value, "#,##0.00")
If Val(TextBox2.Value) < Val(TextBox4.Value) Then Val (TextBox5.Value)=* -1
End Sub
Private Sub TextBox4_Change()
Me.TextBox5.Value = Val(Replace(Me.TextBox2.Value, ",", "")) - Val(Replace(Me.TextBox4.Value, ",", "") )