LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default On Error GoTo : How to use multiple?

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.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
On error from Find, GoTo E jlclyde Excel Discussion (Misc queries) 1 October 8th 08 08:03 PM
On error goto problem Coppercrutch Excel Discussion (Misc queries) 3 December 28th 07 03:04 PM
On Error GoTo Doesn't Work [email protected] Excel Discussion (Misc queries) 2 November 29th 07 09:43 PM
On error goto 0? Brian Tozer Excel Programming 10 December 29th 03 09:59 PM
On error goto 0 David Excel Programming 2 November 18th 03 01:43 PM


All times are GMT +1. The time now is 11:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"