Private Sub TextBox4_Change()
TextBox5 = ""
If TextBox4 <> "" And TextBox3 <> "" Then
TextBox5 = Replace(TextBox4, ".", ",") * Replace(TextBox3, ".", ",")
End If
End Sub
Private Sub TextBox3_Change()
TextBox5 = ""
If TextBox4 <> "" And TextBox3 <> "" Then
TextBox5 = Replace(TextBox4, ".", ",") * Replace(TextBox3, ".", ",")
End If
End Sub
Private Sub UserForm_Initialize() ComboBox1.AddItem ("Boulangerie") ComboBox1.AddItem ("Boucherie") ComboBox1.AddItem ("Autres") '********** Modif TextBox5.Locked = True End Sub Private Sub TextBox3_keyPress(ByVal KeyAsCii As MSForms.ReturnInteger) If InStr("0123456789", Chr(KeyAsCii)) = 0 Then KeyAsCii = 0: Beep End Sub Private Sub TextBox4_KeyPress(ByVal KeyAsCii As MSForms.ReturnInteger) 'TRANSFORMER LE POINT PAR UNE VIRGULE If KeyAsCii = 46 Then KeyAsCii = 44 'ACCEPTER UNIQUEMENT UNE SEULE VIRGULE ET LES CHIFFRES ENTRE 0 ET 9 If InStr("1234567890,", Chr(KeyAsCii)) = 0 Or (InStr(TextBox4.Value, ",") <> 0 And Chr(KeyAsCii) = ",") _ Or (TextBox4.SelStart = 0 And Chr(KeyAsCii) = ",") Then KeyAsCii = 0: Beep End Sub Private Sub TextBox3_Enter() TextBox3.Value = Format(TextBox3.Value, "# ##0") End Sub Private Sub TextBox4_Enter() TextBox4.Value = Format(TextBox4.Value, "# ##0.00") End Sub Private Sub TextBox5_Enter() TextBox5.Value = Format(CDbl(TextBox4.Value) * CDbl(TextBox3.Value), "# ##0.00 €") End Sub