Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, Rob. I guess the exercise for me now is to figure out the
circumstances in which my erroneous approach will actually cause a problem. The way the error handling blocks were set up was not just happenstance. Thanks again, Alan Beban Rob Bovey wrote: Hi Alan, Your procedure appears to work, but that's just a coincidence of the way you structured it. If you place a watch on the Err object and single-step through the code, you'll notice that any Resume statement you hit that wasn't reached as a result of an error actually causes an error itself (Err 20: Resume without error). Because of the way you set up the error handling blocks, however, this error is simply caught by the error handler defined above it. The Resume statement is then executed a second time as a result of the error, which is OK, and it causes execution to resume at the specified line label. To see the problem, try putting "length" and "east" in column B and "md" in column A. Then comment out all of your On Error GoTo statements. If the code was structured correctly, it should run without error, because the Find method locates what it's looking for in every instance. However, you'll see that the code actually bombs when it hits the first Resume statement. Under the same conditions, Stephen's code will execute correctly. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
On error from Find, GoTo E | Excel Discussion (Misc queries) | |||
On error goto problem | Excel Discussion (Misc queries) | |||
On Error GoTo Doesn't Work | Excel Discussion (Misc queries) | |||
On error goto 0? | Excel Programming | |||
On error goto 0 | Excel Programming |