[Public | Private | Friend] [Static] Function name _ [(arglist)] [As type][()] [statements] [name = expression] [Exit Function] [statements] [name = expression] End Function
Gives the function scope through all procedures in all modules in the project. If used within a createable class module, the function is also accessible from outside the project. Public, Private, and Friend are mutually exclusive.
Restricts the scope of the function to those procedures within the same module. Public, Private, and Friend are mutually exclusive.
Only valid within a class module; gives the function 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 function between calls to the function.
The name of the function.
A comma-delimited list of variables to be passed to the function as arguments from the calling procedure.
The return data type of the function.
Program code to be executed within the function.
The value to return from the function to the calling procedure.
arglist uses the following syntax and parts:
[Optional] [ByVal | ByRef] [ParamArray] varname[( )] [As type