D dave Dec 9, 2003 #1 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
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
T Tom Ogilvy Dec 9, 2003 #2 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.
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.