EfBQQ‖

2XaKk‖End Statement

s5S7Q‖Ends a procedure or block.

CNUrX‖Syntax:


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

G9LNz‖Parameters:

AbDDF‖Use the End statement as follows:

mJoxY‖Statement

8sQMm‖End: Is not required, but can be entered anywhere within a procedure to end the program execution.

AnYsp‖End Enum: Ends an Enum VBA statement

XTNbJ‖End Function: Ends a Function statement.

2NwJf‖End If: Marks the end of a If...Then...Else block.

Qo2Xg‖End Property: Marks the end of a Property statement.

3xFEp‖End Select: Marks the end of a Select Case block.

Ciwr2‖End Sub: Ends a Sub statement.

BWTbj‖End With: Ends a With statement

pcgxU‖Example:


Sub ExampleRandomSelect
Dim iVar As Integer
    iVar = Int((15 * Rnd) -2)
    Select Case iVar
        Case 1 To 5
sp2DQ‖            Print "Number from 1 to 5"
        Case 6, 7, 8
7DKM9‖            Print "Number from 6 to 8"
        Case Is > 8 And iVar < 11
Th2BG‖            Print "Greater than 8"
        Case Else
KK2A6‖            Print "Outside range 1 to 10"
    End Select
End Sub