[Public | Private | Friend] [Static] Sub name [(arglist)] [statements] [Exit Sub] [statements] End Sub
Gives the sub procedure scope through all procedures in all modules in the project. If used within a createable class module, the sub procedure is also accessible from outside the project. Public, Private, and Friend are mutually exclusive.
Restricts the scope of the sub procedure to those procedures within the same module. Public, Private, and Friend are mutually exclusive.
Only valid within a class module; gives the sub procedure scope to all modules within a project, but not to modules outside the project. Public, Private, and Friend are mutually exclusive.
Preserves the value of variables declared inside the sub procedure between calls to the sub procedure.
The name of the sub procedure.
Data Type: Any
A comma-delimited list of variables to be passed to the sub procedure as arguments from the calling procedure.
Program code to be executed within the sub procedure.
arglist uses the following syntax and parts:
[Optional] [ByVal | ByRef] [ParamArray] varname[( )] _ [As type] [= defaultvalue]
An optional argument is one that need not be supplied when calling the sub. However, all arguments following an optional ...