Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox1.Value = Format(TextBox1.Value, "#,##0.00")
End Sub
Private Sub textbox1_change()
UpdateValues
End Sub
Private Sub textbox2_change()
UpdateValues
End Sub
Private Sub UpdateValues()
If TextBox1.Value = "" Or TextBox2.Value = "" Then Exit Sub
TextBox3 = Format(Application.RoundDown(TextBox1 / TextBox2.Value, 2) + TextBox1 - (Application.RoundDown(TextBox1 / TextBox2.Value, 2)) * TextBox2, "#,##0.00")
TextBox4 = Format(Application.RoundDown(TextBox1 / TextBox2.Value, 2), "#,##0.00")
End Sub