Hi
I'm would like to perform a calculation of the difference between two textbox on a userform (file attached) in percentage and as a whole figure.
I.e.: TextBox8 = textbox6 - textbox7 / textbox6
Example on userform attached:
textbox4 = 100
textbox5 = 10
textbox6 = 98%
textbox7 = 10% (does automatically a calculation)
So, textbox8 should be = 89.80%
Textbox9 as a whole number should be = 88
Tested without success codes attached.
Thanks R
I'm would like to perform a calculation of the difference between two textbox on a userform (file attached) in percentage and as a whole figure.
I.e.: TextBox8 = textbox6 - textbox7 / textbox6
Example on userform attached:
textbox4 = 100
textbox5 = 10
textbox6 = 98%
textbox7 = 10% (does automatically a calculation)
So, textbox8 should be = 89.80%
Textbox9 as a whole number should be = 88
Tested without success codes attached.
Code:
Private Sub TextBox8_Change()
TextBox8.Value = Format(Val(TextBox6.Value) - Val(TextBox7.Value) / TextBox6.Value, "0.00%")
End Sub
Private Sub TextBox9_Change()
TextBox9.Value = Format(Val(TextBox6.Value) - Val(TextBox7.Value))
End Sub