|
|
Eine Textbox und ein Commandbutton.
Private Sub Command1_Click()
' sind Zahlen in einem Text vorhanden ?
Dim i As Long
Dim a As Long
Dim isZahl As Boolean
For i = 1 To Len(Text1.Text)
For a = 48 To 57 'Zahlen von 0 bis 9
If (Mid(Text1.Text, i, 1)) = Chr(a) Then
' Zahlen sind enthalten
isZahl = True
Exit For
End If
Next
If isZahl Then Exit For
Next
If isZahl Then
MsgBox "Zahlen im Text vorhanden"
ElseIf isZahl = False Then
MsgBox "Keine Zahlen im Text"
End If
End Sub
|
|
|
|
||||