End... Statement |
End Enum End Function End If End Property End Select End Sub End Type End With
Ends a procedure or a block of code.
The End statement is used as follows:
Statement | Description |
---|---|
End | Terminates program execution. |
End Enum | Marks the end of an enumerated type. |
End Function | Marks the end of a Function procedure. |
End If | Marks the end of an If...Then...Else statement. |
End Property | Marks the end of a Property Let, Property Get, or Property Set procedure. |
End Select | Marks the end of a Select Case statement. |
End Sub | Marks the end of a Sub procedure. |
End Type | Marks the end of a user-defined type definition. |
End With | Marks the end of a With statement. |
Although supported, the End statement used by itself to terminate the program shouldn't be used within a VBA application. Instead you should terminate execution of a procedure prematurely using the Exit... statement.