vba default parameter code example
Example: vba default value
Sub nameMe(ByVal p1 As datatype1, Optional ByVal p2 As datatype2 = defaultvalue)
Debug.Print p1 & ", " & p2
End sub
Sub testMe ()
nameMe "John" ' John
nameMe "John", "Doe" ' John, Doe
End Sub