I have a macro that uses the find method to search a column for a value. It's within an If statement, but if the value isn't found in the column then I get an 'Object variable not set' error. I would like for it to see the If statement as false in this case. What's the best way to do this without using an On Error statement?
If Sheets(1).Range("A:A").Find(cell).offset(0, 21) = "Y" Then
Variable1 = True
Else
Variable1 = False
If Sheets(1).Range("A:A").Find(cell).offset(0, 21) = "Y" Then
Variable1 = True
Else
Variable1 = False