Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You could also check to see if your string were found first, then if it was
found, do the .activate: dim FoundCell as Range set foundcell = cells.find(what:="IP Trinity", ...rest of find here) if foundcell is nothing then msgbox "Not found" else foundcell.activate end if And drop the "on error" stuff completely. Coppercrutch wrote: I have the following code: On Error GoTo cont6: Cells.Find(What:="IP Trinity", After:=ActiveCell, LookIn:=xlFormulas, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False).Activate cont6: I have used this because when the required info is not found I was getting a runtime '91' error message - Object variable or with block variable not set? Now the error goto works fine and dandy, but only if there is one error ? I have this error go to in 7 seperate bits of the same sub as I am looking for 7 different things -and it only works the first time it is required ? On the second error it gives the previous 91 message. Is there a simple reason this will only work once in the same sub and cannot be repeated ? -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
On Error GoTo Doesn't Work | Excel Discussion (Misc queries) | |||
Question on "On Error GoTo skip" | Excel Discussion (Misc queries) | |||
On Error GoTo Label in a loop only working once. | Charts and Charting in Excel | |||
On Error GoTo skip needs help | Excel Discussion (Misc queries) | |||
Goto Data validation Same ERROR | Excel Discussion (Misc queries) |