It used for named parameters (ht to SLaks for reference) in a method call and is usually used with optional arguments.
This is usually useful for invoking Word or Excel methods using ActiveX calls, where there are many optional arguments, most of which are never used.
Example
Private Function test(arg1 As Integer, arg2 As Integer) As Boolean Debug.WriteLine("{0} {1}", arg1, arg2) Return True End Function
These two will give the same result.
test(arg2:=2, arg1:=1) test(1, 2)
Debug output
1 2 1 2
source share