K KLZA May 21, 2008 #1 How can I use validation to stop users from entering the following characters?: / \ : * ? " < > |
M MacGuy May 21, 2008 #2 Restrict where? This is code for a text box on a user form and allows specified ascii: Private Sub TEXTBOXNAME_TextBox_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) Select Case KeyAscii Case 48 To 57 ' 0 thru 9 Case 65 To 90 ' A thru Z uppercase. 97 to 122 is lowercase Case Else KeyAscii = 0 End Select End Sub
Restrict where? This is code for a text box on a user form and allows specified ascii: Private Sub TEXTBOXNAME_TextBox_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) Select Case KeyAscii Case 48 To 57 ' 0 thru 9 Case 65 To 90 ' A thru Z uppercase. 97 to 122 is lowercase Case Else KeyAscii = 0 End Select End Sub