Finance

Charts

Statistics

Macros

Search

Structure of a Procedure’s Code with Excel Vba

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.

0 0 votes
Évaluation de l'article
S’abonner
Notification pour
guest
0 Commentaires
Le plus ancien
Le plus récent Le plus populaire
Online comments
Show all comments
Facebook
Twitter
LinkedIn
WhatsApp
Email
Print
0
We’d love to hear your thoughts — please leave a commentx