Private Sub Tb_val_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
'Tb_val = nom de la TextBox
If InStr("1234567890.", Chr(KeyAscii)) = 0 Or InStr(Tb_val.Value, ".") <> 0 And _
Chr(KeyAscii) = "." Then
MsgBox "Vous avez tapé " & "'" & Chr(KeyAscii) & "'" & " : les caractères valables sont les" _
& " chiffres et si décimale(s), un seul point !"
KeyAscii = 0
End If
End Sub
Private Sub Tb_val_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Tb_val.Value <> "" Then
valt = Tb_val.Value
tnum = Replace(tnum, ",", ".")
End If
End sub
Partager