These statements terminate the execution of a block of instructions within the innermost control structure of a specified type or a procedure. Execution is continued after the end of the control structure or the call to the procedure.
Exit Do
-or-
Exit For
-or-
Exit Function
-or-
Exit Property
-or-
Exit Select
-or-
Exit Sub
-or-
Exit Try
-or-
Exit While
Prerequisites
Can only be specified within the control structure or procedure type that is referenced.
Remarks
Each of the forms of the Exit statement are qualified by the type of control structure or procedure being terminated. Please see the documentation on the specific statements and program elements for information on the Exit statements, e.g. see the While…End While Statements for information on the use of Exit While and Sub for the use of Exit Sub.
See Also
Statements |Do… Loop Statements| Exit Try Statement | For…Next Statements| Select...Case Statements | While…End While Statements