Gruppe
Dialog
Problem
Die Eingabelänge einer Tabellenblatt-TextBox soll begrenzt werden. Desweiteren sollen nur Ziffern zugelassen werden.
ClassModule: Tabelle1
Private Sub TextBox1_Change()
Dim sTxt As String
sTxt = TextBox1.Text
If Right(sTxt, 1) Like "[!0-9]" = False Then
MsgBox "Nur Buchstaben erlaubt!"
TextBox1.Text = Left(sTxt, Len(sTxt) - 1)
End If
End Sub
StandardModule: Modul1
Sub TextPostanschrift_BeiÄnderung()
Application.ScreenUpdating = False
dim PostS As String
Dim EingabeText As String
EingabeText = PostS.Text
If IsNumeric(EingabeText) Then
MsgBox "Nur Text ist erlaubt!"
PostS.Text = EingabeNumeric
If Numeric > 0 Then
Text = Left$(Eingabe, Len(EingabeNumeric) - 1)
Else
If Len(PostS) > 3 Then
MsgBox "Text zu Lang!"
End If
End If
End If
Application.ScreenUpdating = True
End Sub