Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following code with an on error statement:
For i = 1 To zz search_term = Workbooks("search.xls").Worksheets("Search Terms").Cells(i, 1) On Error GoTo not_found search_column = Cells.Find(What:=search_term, After:=[A1], LookIn:=xlFormulas, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False).Column [Do Stuff if search_term is found on worksheet] not_found: On Error GoTo 0 Next i The for loop should go through 155 terms. The first time the search_term is not found the on error statement works as it should and the code is bypassed. But the second time the search_term is not found I get an error message on the code line with the Find function. What is going on with my error handling? Is there a better way to control my flow? John Keith |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro error - cant work it out... | Excel Worksheet Functions | |||
DSUM gives a #VALUE! error and I can't work out why! | Excel Worksheet Functions | |||
VBA ON ERROR does not work with SPECIALCELLS | Excel Discussion (Misc queries) | |||
Error control no work :( | Excel Programming | |||
'Help on this error' does not work? | Excel Programming |