End... Statement

Syntax

End Enum
End Function 
End If
End Property 
End Select
End Sub
End Type
End With

Description

Ends a procedure or a block of code.

Rules at a Glance

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.

Programming Tips and Gotchas

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.

See Also

Exit... Statement
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.76.12