Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Help with Error Code Please (Excel 2002/2003)

    Hi

    The code below still runs the msgbox code even if there is no error, any ideas please.




    Private Sub CommandButton8_Click()
    On Error GoTo errhandler
    Sheets("Taski").Select
    Unload Navigationfrm
    errhandler: MsgBox ("No Taski Distributor Selected")

    End Sub

    Regards

    Braddy
    If you are a fool at forty, you will always be a fool

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Help with Error Code Please (Excel 2002/2003)

    Immediately above the errhandler:... line, insert

    Exit Sub

    Without the Exit Sub, code will *always* continue to the errhandler section.

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Help with Error Code Please (Excel 2002/2003)

    HI Hans

    Once again I am in your debt.

    Regards

    Braddy
    If you are a fool at forty, you will always be a fool

Posting Permissions

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