Jacques Labuschagne
Board Regular
- Joined
- Feb 5, 2012
- Messages
- 58
Hi
Hope soembody can help...
The below code works for error handling, but the issue is that if it goes into the error part of the program is return and excutes the previous loop again from where there was no error... Think there is something wrong when I execute the Resume next, but not sure how to solve this.. Any help please...
Regards,
Jacques
Hope soembody can help...
The below code works for error handling, but the issue is that if it goes into the error part of the program is return and excutes the previous loop again from where there was no error... Think there is something wrong when I execute the Resume next, but not sure how to solve this.. Any help please...
Code:
Sub FindText()
On Error GoTo ErrorHandler
Worksheets(1).Cells.Find(What:=te.TxtName, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
MsgBox "Item you looking for " & ActiveCell.Column & " " & ActiveCell.Row & " " & TxtName
Exit Sub
ErrorHandler:
MsgBox "Not Found"
Resume Next
End Sub
Regards,
Jacques