Jim-in-I
Board Regular
- Joined
- Sep 10, 2002
- Messages
- 180
I can not figure out how to handle a Userform Texbox input error. The snipet of code in my Command Button macro is:
If UserForm1.TextBox1.Value = "" Then
MsgBox "You must Enter a New Name", vbOKOnly, "Update Error"
Cancel = True
End If
If the user fails to input anything into the textbox, I would like to return to the start of the macro, (let them try it again). Currently, this code just continues running the next macro steps after the user clicks the OK button.
Can anyone provide some guidance as to how I return to the previous step if the Textbox input is blank?
Jim
If UserForm1.TextBox1.Value = "" Then
MsgBox "You must Enter a New Name", vbOKOnly, "Update Error"
Cancel = True
End If
If the user fails to input anything into the textbox, I would like to return to the start of the macro, (let them try it again). Currently, this code just continues running the next macro steps after the user clicks the OK button.
Can anyone provide some guidance as to how I return to the previous step if the Textbox input is blank?
Jim