Tips for Defining Procedures in VBA

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

When you're defining a Function or Sub procedure, you have options available to you that can make your code more extensible or more flexible. The following sections discuss how to extend your procedures by using optional arguments, using parameter arrays to pass a variable number of arguments, and passing arguments by value and by reference.