GoTo in VBA

后端 未结 5 2096
情书的邮戳
情书的邮戳 2021-02-16 00:10

From the VBA help file:

GoTo Statement

Branches unconditionally to a specified line within a procedure.

Syntax<

5条回答
  •  温柔的废话
    2021-02-16 00:26

    declaring the line number and declaring a lable is basicly the same but using a line number as a big advantage: it does not use memory!

    if your "our of memory" you will not be able to declare a lable but you will be able to declare a line numer and use that as a "goTo"

    sub mySub()
    ....
    on error goto 100
    ...
    exit sub
    100: msgbox("Error")
    end sub

提交回复
热议问题