Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: On Error GoTo - Issue

  1. #1
    New Member
    Join Date
    Aug 2015
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default On Error GoTo - Issue

    Hi!

    I have a problem with my VBA code: When I use the "On Error GoTo..." and an error occurs, the VBA still stops and tells me about the error, and does not allow the code to proceed.

    Here is the code:

    Code:
    On Error GoTo errhandler
    Cells(15 + i, issuecodekol) = WorksheetFunction.VLookup(Cells(15 + i, 2).Value, Sheets("EM_S.06.02_help").Range("A1:O1000"), 3, False)
    Cells(15 + i, issuegroupcodekol).Formula = WorksheetFunction.VLookup(Cells(15 + i, 2).Value, Sheets("EM_S.06.02_help").Range("A1:O1000"), 4, False)
    Cells(15 + i, custodiankol).Formula = WorksheetFunction.VLookup(Cells(15 + i, 2).Value, Sheets("EM_S.06.02_help").Range("A1:O1000"), 5, False)
    errhandler:
    The code stops because the lookup-value does not exists in the lookup area, but this is something I just want it to ignore and keep on from "errhandler". I might have misunderstood something with the errhandler part - hope you can enlighten me.

    Thanks,
    N00bTube

  2. #2
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    32,351
    Post Thanks / Like
    Mentioned
    25 Post(s)
    Tagged
    3 Thread(s)

    Default Re: On Error GoTo - Issue

    Is this in a loop? If so, read this: On Error WTF? | Excel Matters

  3. #3
    New Member
    Join Date
    Aug 2015
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: On Error GoTo - Issue

    Yes, it is in a loop.

    But thanks for the link, I figured it out now

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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