CokeOrCrack
Board Regular
- Joined
- Dec 13, 2015
- Messages
- 81
- I have a userform textbox in which applicants input their email
Question
- I want the @ symbol to be mandatory
- I want a message box to show if there is no @ symbol inputted
My current code is as follows (I have both a Change and Exit sub, I know I can dump them into one Exit sub, but I prefer to require lowercase even upon typing):
Thanks
OJ
Question
- I want the @ symbol to be mandatory
- I want a message box to show if there is no @ symbol inputted
My current code is as follows (I have both a Change and Exit sub, I know I can dump them into one Exit sub, but I prefer to require lowercase even upon typing):
Code:
Private Sub tbEmail_Change()
tbEmail.Text = LCase(tbEmail.Text)
End Sub
Private Sub tbEmail_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If tbEmail.Value = vbNullString Then
MsgBox "Enter Email"
Cancel = True
End If
End Sub
Thanks
OJ