maxhayden
09-02-2009, 08:52 AM
Hi guys!
I've used some code that you guys have helped me on earlier.
y = UserForm1.TextBox1
If Cells(i, 1) = "" Then
Worksheets("instructionsreceived").Columns(1).Find(y, lookat:=xlPart).EntireRow.Range("A1,C1,F1,G1,J1,K1").Copy
Worksheets("Sheet1").Cells(i, 1).Select
Worksheets("Sheet1").Paste
This is great, BUT if there is a number that is not in "instructionsreceived".Columns(1), an error message comes up and it wants debugging on that line of code.
Is there anyway I can put an if it can't find then Warning.Show
Rather than having the VBA/Excel error message come up??
(Warning being my own userform that informs the user that the number they're trying to find does not exist in the database.
I've used some code that you guys have helped me on earlier.
y = UserForm1.TextBox1
If Cells(i, 1) = "" Then
Worksheets("instructionsreceived").Columns(1).Find(y, lookat:=xlPart).EntireRow.Range("A1,C1,F1,G1,J1,K1").Copy
Worksheets("Sheet1").Cells(i, 1).Select
Worksheets("Sheet1").Paste
This is great, BUT if there is a number that is not in "instructionsreceived".Columns(1), an error message comes up and it wants debugging on that line of code.
Is there anyway I can put an if it can't find then Warning.Show
Rather than having the VBA/Excel error message come up??
(Warning being my own userform that informs the user that the number they're trying to find does not exist in the database.