Named Arguments

In the standard syntax for the argument list, when calling a procedure, the arguments must be passed in the exact order they are listed in the procedure definition. Also, no arguments (other than optional arguments) can be omitted. It is sometimes more convenient to use named arguments, particularly when a procedure has many optional arguments that are often not passed. You have seen named arguments used many times in earlier chapters when dealing with VBA's built-in procedures. To pass a named argument, use the syntax

						argname:=value
					

in which argname is the name of the argument in the procedure definition, and value is the argument value. Note the special := operator that is used only for named arguments. Suppose you have a ...

Get Office® XP Development with VBA now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.