Public WithEvents txt As MSForms.TextBox, X, t As Variant
Private Sub txt_Change()
On Error Resume Next
With User
X = 0
For Each t In Array(.T21, .T23, .T25)
X = X + t
Next t: .T27 = Replace(Format(.T20 - X, "0.00 €"), ".", ",")
End With
End Sub
Private Sub txt_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 13 And txt <> "" Then txt = Replace(Format(txt, "0.00 €"), ".", ",")
End Sub
Private Sub txt_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If InStr("0123456789.,", Chr(KeyAscii)) = 0 Then KeyAscii = 0
End Sub