Basically all I want to do is use the Find method to search for a string of text. However, if excel doesnt find the string it gives you a visual basic error sayin runtime "error 91 object variable or with block variable not set", so im trying to avoid this error. I just want excel to not do anything if it can't find the string. I tried with the following code but it didnt work, thanks
Cells.Find(what:="text", after:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate
If ActiveCell.Value <> "text" Then End
Cells.Find(what:="text", after:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate
If ActiveCell.Value <> "text" Then End