Microsoft Office 2000/Visual Basic Programmer's Guide   

Tips for Defining Procedures in VBA

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.