If the text field is empty and I click the backspace button, it crashed and the highlighted line
TB1 = Left (TB1, Len (TB1) - 1)
what can i change to stop this glitch
Private Sub TB1_Change()
Dim strStrings As String, LastLetter As String
Application.EnableEvents = False
LastLetter = Right(TB1, 1)
strStrings = ","
If InStr(1, strStrings, LastLetter) > 0 Then
MsgBox LastLetter & " not allowed"
TB1 = Left(TB1, Len(TB1) - 1)
End If
Application.EnableEvents = True
End Sub
This is a text box where "," is limited.
source
share