1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| Function GetDoubleFromBox(box As MSForms.TextBox, ByRef Value As Double) As Boolean
Dim Temp
Temp = Replace(Replace(Replace(box.Text, " ", ""), ".", ","), ",", Application.International(xlDecimalSeparator))
GetDoubleFromBox = IsNumeric(Temp)
If GetDoubleFromBox Then Value = CDbl(Temp)
End Function
Sub validAll()
Dim V As Double
If Not GetDoubleFromBox(TextBox1, v1) _
Or Not GetDoubleFromBox(TextBox2, v2) _
Or Not GetDoubleFromBox(TextBox3, v3) Then
Exit Sub
End If
'reste du code
End Sub |
Partager