Re : Problème de décimales dans un total
Bonjour pierrejean,
Voilà tout ce qui concerne les TextBox.
Private Sub Txt_De0a15_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii = 46 Then KeyAscii = 44
If InStr("0123456789.,+-*/", Chr(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End Sub
Private Sub Txt_De0a15_AfterUpdate()
On Error Resume Next
Txt_De0a15.Value = Evaluate(Replace(Txt_De0a15.Value, ",", "."))
Txt_De0a15 = Format(Txt_De0a15, "### ### ##0.00")
Somme
End Sub
Private Sub Txt_De15a45_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii = 46 Then KeyAscii = 44
If InStr("0123456789.,+-*/", Chr(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End Sub
Private Sub Txt_De15a45_AfterUpdate()
On Error Resume Next
Txt_De15a45.Value = Evaluate(Replace(Txt_De15a45.Value, ",", "."))
Txt_De15a45 = Format(Txt_De15a45, "### ### ##0.00")
Somme
End Sub
Private Sub Txt_Plus45_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii = 46 Then KeyAscii = 44
If InStr("0123456789.,+-*/", Chr(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End Sub
Private Sub Txt_Plus45_AfterUpdate()
On Error Resume Next
Txt_Plus45.Value = Evaluate(Replace(Txt_Plus45.Value, ",", "."))
Txt_Plus45 = Format(Txt_Plus45, "### ### ##0.00")
Somme
End Sub
@+