+ Reply to Thread
Results 1 to 5 of 5

On Error GoTo 0 help

  1. #1
    Forum Contributor
    Join Date
    05-30-2013
    Location
    Isreal
    MS-Off Ver
    Excel 2010
    Posts
    191

    On Error GoTo 0 help

    Hi,
    I was using On Error GoTo 0
    Which was part of another module I found online and modified.
    I tried to read on the various forms regarding On Error GoTo 0
    However I’m not sure if I use On Error GoTo 0 that means that next time there is an error it will acknowledge the error and notify the user that there is an error.
    Can somebody help with this?

    Eli

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

    Re: On Error GoTo 0 help

    It erases the previous error trapping error, so you are back to normal with out error trapping.
    E.g you have a line
    on error resume next

    if you include on error go to 0, this line will delete(Erase) the resume next.
    The purpose of this line is you do not want to apply the error trapping to the entire code.
    Last edited by AB33; 09-24-2015 at 04:58 AM.

  3. #3
    Forum Contributor
    Join Date
    05-30-2013
    Location
    Isreal
    MS-Off Ver
    Excel 2010
    Posts
    191

    Re: On Error GoTo 0 help

    Thank you for your response.


    If I understand you correctly.
    That if I use on error resume next if I did not use On Error GoTo 0 the next error I will have it will ignore the error.

    Am I correct?

    If I understand you correctly.
    That if I use on error resume next if I did not use On Error GoTo 0 the next error I will have it will ignore the error.

    Am I correct?

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

    Re: On Error GoTo 0 help

    Yes, the error trap will pick up any error on the code unless you tell VBA to stop the trapping at a specific line. It is bad practice to put in resume next error trap on all part of the code.
    Let' say, I do not want to get an error message on this line. If I do not take out the error trapping after the first line and if there are lines of code after first line and have errors, the code will ignore these errors, hence for using on selective line. You could use it on multiple lines on a single code.

    Please Login or Register  to view this content.
    Last edited by AB33; 09-24-2015 at 05:42 AM.

  5. #5
    Forum Contributor
    Join Date
    05-30-2013
    Location
    Isreal
    MS-Off Ver
    Excel 2010
    Posts
    191

    Re: On Error GoTo 0 help

    Thank you for your explanation is great.

+ 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. help with on error goto -1
    By ammartino44 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-01-2015, 01:43 PM
  2. [SOLVED] .Match with On Error: On Error Resume Next works. On Error GoTo only works once. Err.Clear
    By Doc.AElstein in forum Excel - New Users/Basics
    Replies: 28
    Last Post: 03-16-2015, 12:55 PM
  3. [SOLVED] Error Occurs while running to On Error Goto Line3
    By moinsk21 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-01-2014, 02:37 PM
  4. Run-time error '91' when 'On error goto' and cells.find
    By bjoern in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2008, 07:27 PM
  5. On Error Goto (Global Error Handling)
    By mpeplow in forum Excel General
    Replies: 3
    Last Post: 04-10-2007, 11:33 PM
  6. 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
  7. Use of ON ERROR GOTO 0
    By davidm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-04-2005, 04:44 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