+ Reply to Thread
Results 1 to 6 of 6

Error handling inside error handling

  1. #1
    Registered User
    Join Date
    12-08-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    37

    Error handling inside error handling

    Hi
    I am after a way to handle an error occuring inside an error handler
    My code is as follows
    Please Login or Register  to view this content.
    If an error occurs at
    Please Login or Register  to view this content.
    This means that the job number is still not valid even after it has tried to be corrected.
    I would like the
    MsgBox ("Job not present, Please start new job first")
    to show.

    Any ideas???

    Cheers
    Grant Astley

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Error handling inside error handling

    If the error comes from non-match of the look up formula, you can incorporate the iferror function on

    Please Login or Register  to view this content.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Error handling inside error handling

    You could try removing WorksheetFunction and declaring as a Variant.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Error handling inside error handling

    I'd also suggest using Match in the second half rather than looking up the same value repeatedly:

    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  5. #5
    Registered User
    Join Date
    12-08-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Error handling inside error handling

    Thank you everyone.
    AB33 yes that is where the error was coming from and as such Norie you code works a treat
    Rory I did use your version of the code to use the match instead of the vlookups over and over. I am assuming that the match is quicker and that is why you suggested using it?

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Error handling inside error handling

    Correct. It would be the same with formulas - always faster to use one MATCH formula to get the position then use that in several INDEX formulas rather than use VLOOKUP repeatedly.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. RUN TIME ERROR '1004' error handling help needed
    By skop89 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-09-2014, 12:54 PM
  2. [SOLVED] Error Handling: Creating code to display error messages
    By Student1990 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-01-2013, 02:21 PM
  3. Error Handling: Can it report line # where error occurred?
    By PingPing in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-20-2010, 03:47 AM
  4. [SOLVED] Error Handling - On Error GoTo doesn't trap error successfully
    By David in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-16-2006, 02:10 PM
  5. [SOLVED] Error handling with a handling routine
    By ben in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-15-2005, 11:06 AM

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