Gixxer, The answer to this is to use optional arguments for the function
like this:
Public Sub MyFunc(Optional A As Integer, Optional B As Integer)
End Sub
You will need something in the procedure that requires the arguments to
check if they have been provided or not. If they are not, A and B will
return 0 by default.
Hope this helps, Jack
"Gixxer_J_97" wrote:
> is there a way to overload a function in vba?
> ie
> public sub myfunc(a, as integer, b as integer)
> end sub
>
> and
>
> private sub myfunc()
> end sub
>
> where the private sub is used for the 'local' userform - and the public sub
> is called by an outside module (where a and b would be the arguments that
> would normally be accessed by the userform, but in this case need to be
> passed)
>
> ?
Bookmarks