Hi All,
I have a userform that has a label that, when clicked, will take the user to the respective sheet and select the cell of what they have entered into a text field. Essentially just a automatic Ctrl+F button.
The code I am using works fine when the value exists but crashes when an non-existent value is entered. I knew this was going to be a problem, but I don't know what to add to the code to make it ignore/tell the user it was not found, rather than just crashing completely.
How can I fix my problem? Thanks in advance.
I have a userform that has a label that, when clicked, will take the user to the respective sheet and select the cell of what they have entered into a text field. Essentially just a automatic Ctrl+F button.
The code I am using works fine when the value exists but crashes when an non-existent value is entered. I knew this was going to be a problem, but I don't know what to add to the code to make it ignore/tell the user it was not found, rather than just crashing completely.
Code:
Private Sub Label3_Click()
ThisWorkbook.Sheets("HS").Activate
ActiveWorkbook.Worksheets("HS").Columns(1).Find(TextBox1.Value).Select
End Sub
How can I fix my problem? Thanks in advance.