Function calc() As Double
Dim percent#
TextBox10 = Replace(TextBox10, ".", ",")
TextBox11 = Replace(TextBox11, ".", ",")
percent = IIf(TextBox11 = "", 0, TextBox11)
If IsNumeric(TextBox10) And IsNumeric(percent) Then 'on teste les deux au cas ou en est a la virgule
calc = Round(CDbl(TextBox10) * ((CDbl(percent) + 100) / 100), 3)
End If
End Function
Private Sub TextBox10_AfterUpdate()
TextBox10.Value = Format(TextBox10.Value, "0.00 €")
End Sub
Private Sub TextBox10_Change()
TextBox12 = Format(calc, "0.00 €")
End Sub
Private Sub TextBox11_Change()
TextBox12 = Format(calc, "0.00 €")
End Sub
Private Sub TextBox12_AfterUpdate()
TextBox12.Value = Format(TextBox12.Value, "0.00 €")
End Sub
Public Sub Textbox10_KeyPress(ByVal keyascii As MSForms.ReturnInteger)
With TextBox10
If keyascii = 46 Then keyascii = 44
If Chr(keyascii) Like "[!0-9|,-]" Then keyascii = 0
If (Len(.Value) = 0 Or .Value Like "*,*") And Chr(keyascii) = "," Then keyascii = 0
If Chr(keyascii) = "-" And .Value <> "" Then keyascii = 0
End With
End Sub