Guys
I'm trying to write some code that will search a sheet for variable1 and then assign the row number that the result is in to variable2
Got as far as
variable2 = Sheets("Sheet1").Range("J:J").Find(What:=variable1, LookAt:=xlPart).Row
However if variable1 isn't found it bombs out. How would I go about setting variable2 to 1000 when this happens
Thanks
Jim
I'm trying to write some code that will search a sheet for variable1 and then assign the row number that the result is in to variable2
Got as far as
variable2 = Sheets("Sheet1").Range("J:J").Find(What:=variable1, LookAt:=xlPart).Row
However if variable1 isn't found it bombs out. How would I go about setting variable2 to 1000 when this happens
Thanks
Jim