@ symbol

  • Thread starter Thread starter dave
  • Start date Start date
D

dave

i have a VBA form and i need to make sure the user enteres
an @ symbol in a text box

any help will be great

thanks
 
in the exit event

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
if instr(Textbox1.Text,"@") = 0 then
msgbox "Please enter an @ symbol"
Cancel = True
End if
End Sub

You might want to put a similar check in the code that will drop the
userform.
 
Back
Top