Sorry - rubbish title.
I'm looking for some advice. I have 50 Textboxes on a userform and I wish to prevent a user from entering info in each one that begins with an 'I'. My code works fine but naturally I don't wish to have it repeated 50 times. How would I incorporate it into a loop and what would I call the Sub?
Private Sub Textbox1_Change()
If Left(Textbox1.Text, 1) = "I" Or Left(Textbox1.Text, 1) = "i" Then
MsgBox "Codes cannot begin with 'I'", vbOKOnly, "Sorry"
Textbox1.Text = ""
End If
End Sub
Bookmarks