End Statement

Ends a procedure or block.

Синтакса


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

Параметри:

Use the End statement as follows:

Исказ

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

End Enum: Ends an Enum VBA statement

End Function: Ends a Function statement.

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

End Select: Marks the end of a Select Case block.

End Sub: Ends a Sub statement.

End With: Ends a With statement

Пример


Sub ExampleRandomSelect
Dim iVar As Integer
    iVar = Int((15 * Rnd) -2)
    Select Case iVar
        Case 1 To 5
            Печати "број од 1 до 5"
        Case 6, 7, 8
            Печати "број од 6 до 8"
        Case Is > 8 And iVar < 11
            Печати "поголемо од 8"
        Case Else
            Печати "надворешен опсег 1 до 10"
    End Select
End Sub

Please support us!