End Statement

プロシージャーやブロックの終了を宣言します。

構文:


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

パラメーター:

End ステートメントは、下記のように使用します。

ステートメント

終了期:必ずしも使用する必要はありませんが、プロシージャー中でプログラムの実行を終了させたい任意の位置に配置できます。

End Enum: Ends an Enum VBA statement

End Function:Function ステートメントの終了を宣言します。

End If:If...Then...Else ブロックの終了を宣言します。

End Property: Marks the end of a Property statement.

End Select:Select Case ブロックの終了を宣言します。

End Sub:Sub ステートメントの終了を宣言します。

End With: Ends a With statement

例:


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

ご支援をお願いします!