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.