On Error GoTo, On Error Resume Next, and GoTo 0 in Excel VBA - Code Included

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ธ.ค. 2024

ความคิดเห็น • 41

  • @gregsdoodles4547
    @gregsdoodles4547 2 ปีที่แล้ว +1

    I've never seen anyone use backspace as much as this guy....great content, just an observation

  • @pierremonjaret5205
    @pierremonjaret5205 3 ปีที่แล้ว +1

    Hello mister, I'm a french student and I have an important project and your awesome video help me and my group a lot. Thank you very much ! You are the best !

  • @hedgewizardly
    @hedgewizardly 4 ปีที่แล้ว +1

    Ah! It was the Exit Sub before the error handler that was confusing me and wasn't mentioned anywhere else I looked. Thanks!

  • @yainattapon2521
    @yainattapon2521 3 ปีที่แล้ว +1

    I like whten you say "This is very helpful", of course they are! many thanks. 😊

  • @nigelmoreira5940
    @nigelmoreira5940 3 ปีที่แล้ว +1

    Hi, I am facing an error while I run the following code:
    On Error Resume Next
    Set userRange = Application.InputBox(Prompt:="Enter the cell where you would like to insert the positions of " & n, Type:=8)
    On Error GoTo 0

    If userRange Is Nothing Then MsgBox ("No Range was entered")
    End If
    Saying that End If without Block If; Can you help with this? Thanks in advance.
    Note: This is just a block of code but the error comes up when I keep the If statement at the end.

    • @EverydayVBAExcelTraining
      @EverydayVBAExcelTraining  3 ปีที่แล้ว

      After "then" you need to add a new line or remove your end if.
      If statements be on one line and if they are you don't need and end if

  • @brunomaia6007
    @brunomaia6007 4 ปีที่แล้ว +1

    Good info. Would be nice if you wrote the codes separately instead of commenting out the previous version. Thank you

  • @vinoth181988
    @vinoth181988 3 ปีที่แล้ว

    Sometimes in error goto wrking getting runtime error 91 how to resolve this pls help me out

  • @Juan-Hdez
    @Juan-Hdez 10 หลายเดือนก่อน

    Very useful. Thank you.

  • @vishwarajgupta1963
    @vishwarajgupta1963 4 ปีที่แล้ว +1

    HI,
    Thanks for this wonderful video. One question please - if in VBA query first I have used On error resume next because i wanted to ignore the errors on top and then later on at some point down If error occurs I need to goto xxxxxx: for that i used this on error goto xxxx: so do you think it will be fine. Or it will still go to first resume next and then come to this second error part. request your answer please

    • @EverydayVBAExcelTraining
      @EverydayVBAExcelTraining  4 ปีที่แล้ว

      You would have multiple goto lines it would look a little like this
      GoTo first:
      Code
      GoTo Second
      Exit Sub
      First:
      Exit sub
      Second:
      Exit sub
      End Sub

  • @eug_gino
    @eug_gino 5 ปีที่แล้ว +1

    really straightforward tutorial, tysm

  • @edgarayala7741
    @edgarayala7741 4 ปีที่แล้ว +1

    Thank you, your video was very helpful

  • @PemyAtencio
    @PemyAtencio 3 ปีที่แล้ว +1

    Very helpful! thank you so much! you just saved me from staying til dawn. 😂😂

  • @elzix0780
    @elzix0780 8 ปีที่แล้ว

    Thank you for this video, this is exactly what Im working on for my project.
    If after the error handler you expect another error, can you create another error handler?
    Thank you.

    • @EverydayVBAExcelTraining
      @EverydayVBAExcelTraining  8 ปีที่แล้ว +1

      Great Question... I just posted a Video that shows you how to handle multiple errors
      th-cam.com/video/bqZBE7ioimQ/w-d-xo.html

    • @elzix0780
      @elzix0780 8 ปีที่แล้ว +1

      +EverydayVBA
      Thank you very much. It worked perfectly for my project.

  • @Gokuandsims16
    @Gokuandsims16 4 ปีที่แล้ว +1

    Man!! You saved my life hahaha Thanks!

  • @keshavsingh2225
    @keshavsingh2225 8 ปีที่แล้ว

    Thank you sir for this video.
    But I still have some doubt on "on error goto 0". I am not able to make a difference when i am simpally running my code and when i am running with the "on error goto 0". In both cases i am getting the same output.
    my code is :-
    sub fun
    on error goto 0
    if 0/0 = true then
    msgbox "keshav singh"
    end if
    end sub
    fun

  • @luisdso1300
    @luisdso1300 7 ปีที่แล้ว

    thank you sir, i understand that on error goto 0 , stop the code where is the error, is it true?

    • @EverydayVBAExcelTraining
      @EverydayVBAExcelTraining  7 ปีที่แล้ว

      +Luis dso on error goto 0 resets the way excel handles errors. If you add that to the code it will act like like it does by default for the rest of the code. In other words after the goto 0 the debug window will pop up if excel encounters an error.

  • @user-pu2zp2ke2l
    @user-pu2zp2ke2l 2 ปีที่แล้ว

    Great thanks

  • @adadmohamedcherif3697
    @adadmohamedcherif3697 6 ปีที่แล้ว +1

    very clear thank you EverydayVBA

  • @CarlosMoreno-vw4ir
    @CarlosMoreno-vw4ir 6 ปีที่แล้ว +1

    Awesome!! Thanks a lot !

  • @mahdouchsfaq
    @mahdouchsfaq 6 ปีที่แล้ว +1

    Thank you

  • @Meolimo
    @Meolimo 5 ปีที่แล้ว +1

    Tks ! :-)

  • @alializadeh8195
    @alializadeh8195 2 ปีที่แล้ว

    Thanx

  • @tj9382
    @tj9382 5 ปีที่แล้ว +1

    👍

  • @sebastianr7512
    @sebastianr7512 3 ปีที่แล้ว +1

    Thanks a lot

  • @mariotenneriello
    @mariotenneriello 2 ปีที่แล้ว +1

    thank you