1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| Dim sommeTB As Double, valTB As Double, result As Double
Function Cdbl_RemplaceSeperateurDecimal(valeur)
Cdbl_RemplaceSeperateurDecimal = Replace(valeur, ".", Format(0, "."))
If Cdbl_RemplaceSeperateurDecimal <> "" Then
If IsNumeric(Cdbl_RemplaceSeperateurDecimal) Then
Cdbl_RemplaceSeperateurDecimal = CDbl(Cdbl_RemplaceSeperateurDecimal)
End If
End If
End Function
Private Sub TextBox1_Change()
If TextBox1 > 0 Then
calcul
End If
End Sub
Private Sub TextBox2_Change()
calcul
End Sub
Private Sub TextBox3_Change()
calcul
End Sub
Private Sub TextBox4_Change()
calcul
End Sub
Private Sub calcul()
sommeTB = Val(TextBox2) + Val(TextBox3) + Val(TextBox4)
valTB = Val(TextBox1)
result = valTB - sommeTB
TextBox5 = result
End Sub |
Partager