Overloading function calls

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have some custom vba module procedures and I wanted to make some of the
parameters optional (by setting a default value) so that I could use
different signatures.

I was wondering if anyone could help out with and example of how you do it,
if it is possible.

Thanks
 
Optional parameters are easy:

Sub XXX(V As Long, _
Optional Q As Long = 99, _
Optional R As String = "Hello")

and you can even use named arguments if you like

XXX V:=123, R:="Goodbye"

See Help for the Sub and Function statements and IsMissing() function
for more.
 
Back
Top