Call Statement

Transfers control to a Sub or Function procedure.

Syntax

[Call] name [argumentlist]

Arguments:

  • Call: Optional keyword. If specified, you must enclose argumentlist in parentheses.

    For example:

    Call MyProc(0)
  • Name: Required. Name of the procedure to call.

  • Argumentlist: Optional. Comma-delimited list of variables, arrays, or expressions to pass to the procedure.

Remarks

You are not required to use the Call keyword when calling a procedure. However, if you use the Call keyword to call a procedure that requires arguments, argumentlist must be enclosed in parentheses.

Example:


Call MySub("Hello World")
Sub MySub(text)
    'Operations based on requirement using value of text
End Sub