From the VBA help file:
GoTo Statement
Branches unconditionally to a specified line within a procedure.
Syntax<
One very useful purpose for old fashion line numbers is for error handling. Many folks utilize a standard error handler of the Sort:
proc name (args) on error goto handler code . . exit proc
handler: debug.print err.number & "(" & err.description & ") in Module: " & ModuleName & "- Proc:" & ProcName at & now
resume next
Exit Proc
Which can be made somewhat more useful In the code Is line numbered, as the ErrLine Property will return the line number of the offending executable line.
debug.print err.number & "(" & err.description & ") - on Line " & errLine & " in Module: " & ModuleName & "- Proc:" & ProcName at & now