+ Reply to Thread
Results 1 to 2 of 2

Multiple error handling in VBA

  1. #1
    Registered User
    Join Date
    06-07-2013
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    1

    Multiple error handling in VBA

    Hi all, I've searched and searched for the answer to this but no luck. I'm sure it's just me overlooking something simple.

    I have some VBA code that opens a saved workbook, uses COUNTIF in column A to compare reference numbers in that workbook with the list of reference numbers in the original workbook.
    It then filters the data on column A to zero (i.e. all the reference numbers that don't exists in the original), and then copies those rows and pastes them in to the original workbook. This bit works fine.

    I have an 'On Error Goto <label>' statement in there that skips to a point further down the code if there are no new references. This works fine too.

    The problem is, this code then moves on to another workbook and does something similar, but I don't seem to be able to get similar error handling happening.
    i.e. when this third workbook is filtered and finds no new rows to copy into the original, how do I skip to another point further down the code.

    I do hope that makes sense to at least one of you.
    Unfortunately I don't have the workbook to hand right now so I'm unable to post the code.

    Many thanks in advance for any help.

    John.

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Multiple error handling in VBA

    once an error occurs you are in error handling mode until either your routine ends, or you have a resume statement (or you use 'on error goto -1' but don't do that). without seeing your code it's hard to say what is best but what you describe doesn't sound like it ought to raise an error at all-or at least could be written without doing so
    Josie

    if at first you don't succeed try doing it the way your wife told you to

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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