Hallo Paul,
noch eine Möglichkeit:
Private Sub Command2_Click()
Dim d As Double
If GetDoubleWE(Me.Text1.Text, d) Then
Me.Text2.Text = CStr(d)
Else
Me.Text2.Text = ""
MsgBox "Ungültige Eingabe"
End If
End Sub
Public Function GetDoubleWE(ByVal sVal As String, ByRef dVal As Double) As Boolean
Dim d As Double
On Error GoTo ErrorHandler
d = CDbl(sVal)
dVal = d
GetDoubleWE = True
ErrorHandler:
End Function
Damit wird auch z.B. 1,23E+5 akzeptiert.
pablo
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP