Private Sub Text1_change() Dim Prix As Single Dim prixtot As Single If Text1.Value = "" Then Exit Sub Else Prix = Text1.Value End If prixtot = prix_save prixtot2 = prixtot + Prix prixtotal.Value = prixtot2 End Sub Private Sub Text1_keypress(ByVal Keyascii As MSForms.ReturnInteger) Dim Prix As Single Dim prixtot As Single If InStr("1234567890.", Chr(Keyascii)) = 0 _ Or InStr(Text1.Value, ".") <> 0 And Chr(Keyascii) = "." Then Keyascii = 0: Beep ElseIf Chr(Keyascii) = 8 Then If Text1.Value = "" Then Exit Sub Else Prix = Text1.Value End If prixtot = prix_save prixtot2 = prixtot + Prix prixtotal.Value = prixtot2 End If End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question