LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 215
Default On Error GoTo ... But wait!

Hello;
Here's a simple illustration:
-------------------------------------------------------
Sub Test_1()
On Error GoTo myErrorHandler
For MyIndex = 1 To 40
....myCode1
Next myIndex
....myCode2
Exit Sub

myErrorHandler:
MsgBox "The non-linear multi-variant algorithm failed ..."
End Sub
--------------------------------------------------------
I would like to clear (or suppress) the Err object, if any run-time error
occurs within the For loops, until the For loops are complete.
If there's a run-time error for the current value of myIndex, then move to
the next value of myIndex.
If there's at least one error-free loop at the end of the For ... Next, then
ignor any run-time error(s) which might have been encountered and resume
next.
If there is no viable solution (i.e.; no error-free loop at the end of the
For ... Next), then GoTo myErrorHandler.

Could someone please show how-to accomplish that?
You might prefer to put the procedure in a separate routine to be called
from within the For ... Next.

Thank you kindly.
 
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
Error Handling - On Error GoTo doesn't trap error successfully David Excel Programming 9 February 16th 06 05:59 PM
On Error GoTo benb Excel Programming 3 January 5th 05 01:15 AM
On Error Goto doesn't goto Paul Excel Programming 1 October 15th 04 03:51 PM
On Error Goto doesn't goto Paul Excel Programming 0 October 15th 04 03:05 PM
On error goto 0? Brian Tozer Excel Programming 10 December 29th 03 09:59 PM


All times are GMT +1. The time now is 12:31 AM.

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"