Many methods in VBA have arguments that let you specify options for the action to be performed.
If the Wag method of the Tail object of our mythical robodog has arguments (for
example, WagRate, the number of wags per second; WagTime, the duration of wagging in
seconds; and WagArc, the number of degrees of arc in each wag), you can specify them using
either of two syntaxes.
In the first syntax, which is often called the by-name syntax, you name each argument you
use, in any order. For example, this statement wags the tail three times per second for an
hour, over an arc of 180 degrees:
Robodogs("Fido").Tail.Wag _ WagRate := 3, _ WagTime := 3600, _ WagArc := 180You assign a value to an argument by using a colon and an equal sign, and you separate arguments with commas.
Robodogs("Fido").Tail.Wag(3,3600,180)Notice that the list of arguments is surrounded by parentheses. The by-position syntax isn’t as easy to read as the by-name syntax because you have to remember the order of arguments, and when you review the code at a later date, you won’t have the argument names to refresh your memory about their settings.