Visual Basic Language Reference  

End

When used with an additional keyword, End indicates the end of the definition of a procedure or block.

End Class
End Enum
End Function
End Get
End If
End Interface
End Module
End Namespace
End Property
End Select
End Set
End Structure
End Sub
End SyncLock
End Try
End While
End With

Parts

End
Required. Terminates the definition of the procedure or block.
Class
Required to end a Class definition.
Enum
Required to end an Enum definition.
Function
Required to end a Function procedure definition. If execution encounters an End Function statement, control is returned to the calling code.
Get
Required to end a Property procedure definition to retrieve the property's value. If execution encounters an End Get statement, control is returned to the statement requesting the value.
If
Required to end the definition of the If?Then?Else statements.
Interface
Required to end an Interface definition.
Module
Required to end a Module definition.
Namespace
Required to end a Namespace definition.
Property
Required to end a Property definition.
Select
Required to end the definition of the Select...Case statements.
Set
Required to end a Property procedure definition to set the property's value. If execution encounters an End Set statement, control is returned to the statement setting the value.
Structure
Required to end a Structure definition.
Sub
Required to end a Sub procedure definition. If execution encounters an End Sub statement, control is returned to the calling code.
SyncLock
Required to end the definition of the SyncLock...End SyncLock statements.
Try
Required to end the definition of the Try?Catch?Finally statements.
While
Required to end the definition of the While statement.
With
Required to end the definition of the With...End With statements.

Remarks

The End statement, without an additional keyword, terminates execution immediately.

See Also

End Statement | Class Statement | Enum Statement | Function Statement | If...Then...Else Statements | Interface Statement | Module Statement | Namespace Statement | Property Statement | Select...Case Statements | Structure Statement | Sub Statement | SyncLock Statement | Try...Catch...Finally Statements | While...End While Statements | With...End With Statements