Optional Arguments


You can make specific arguments optional by using the Optional keyword:

 Function Myfunction (Target as String, Optional Flag as Integer) 

In this example, the user has to specify the parameter Target as a string, but the parameter Flag will appear with square brackets around it and need not be specified. All optional parameters must come after the required ones.




Excel VBA Macro Programming
Excel VBA Macro Programming
ISBN: 0072231440
EAN: 2147483647
Year: 2004
Pages: 141

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net