Results 1 to 3 of 3

OnError not working

Threaded View

  1. #1
    Forum Contributor
    Join Date
    01-09-2009
    Location
    Cedar Hill, Tx
    MS-Off Ver
    Excel 2003
    Posts
    200

    OnError not working

    Howdy, y'all:

    Here's the code where I'm having problems:

       If ActiveCell.Offset(0, 9) <> "" Then
            On Error GoTo rCont
            UserForm1.lbReasons.SetFocus
            UserForm1.lbReasons = ActiveCell.Offset(0, 9)
            GoTo rCont1
    rCont:
            addTempReason (ActiveCell.Offset(0, 9))
            UserForm1.lbReasons.RowSource = "reasonList"
            UserForm1.lbReasons = ActiveCell.Offset(0, 9)
    rCont1:
            On Error GoTo 0
        End If
        If ActiveCell.Offset(0, 10) <> "" Then
            On Error GoTo rCont2
            UserForm1.lbSelectStandbyAM.SetFocus
            UserForm1.lbSelectStandbyAM = ActiveCell.Offset(0, 10)
            GoTo rCont3
    rCont2:
            addTempDriver (ActiveCell.Offset(0, 10))
            UserForm1.lbSelectStandbyAM = ActiveCell.Offset(0, 10)
    rCont3:
            On Error GoTo 0
        End If
    I've got a record that I'm trying to work with that will cause an error in both of these code segments. The error is handled properly in the first segment but not in the second - I get an error that points to the line that I've shown in red. But it seems that the errorStatements for that code segment would be working and that's not the case.

    Any ideas what I'm doing wrong?

    TIA.

    Bob
    Last edited by bstubbs; 08-07-2009 at 06:11 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1