Gruppe
Dialog
Problem
Wie kann ich in einer UserForm-TextBox die Eingabe von Sonderzeichen verhindern?
ClassModule: frmTextPruefung
Private Sub cmdWeiter_Click()
Unload Me
End Sub
Private Sub txtPruefung_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If Chr(KeyAscii) Like "[0-9 a-z A-Z]" = False Or _
KeyAscii = 32 Then
Beep
MsgBox "Nur Zahlen und Buchstaben erlaubt!"
KeyAscii = 0
End If
End Sub
StandardModule: basMain
Sub CallForm()
frmTextPruefung.Show
End Sub