Structure of a Procedure’s Code
So, we have recorded a macro, and the macro recorder we used created a procedure in a module. In general, a procedure has the following form:
Sub ProcedureName(ParameterList) Instructions End Sub
- ParameterList — this is a list of parameters on which the function depends. The parameters are separated by commas. The parameter list may also be absent — i.e., empty (see, for example, Listing 1.5).
- Instructions — this is a sequence of instructions executed when the procedure runs. Together, they form what is called the body of the procedure.
NOTE
A procedure may exit early using the Exit Sub instruction. Multiple Exit Sub statements can be present in the body of a procedure.