JenniferMurphy
Well-known Member
- Joined
- Jul 23, 2011
- Messages
- 2,687
- Office Version
- 365
- Platform
- Windows
I came across this page that explains Named Arguments.
But I can't get it to work. Here's the little test function I wrote:
I tried calling it like this
Is this just a VB.Net feature?
Understanding named arguments and optional arguments (VBA)
Office VBA reference topic
learn.microsoft.com
But I can't get it to work. Here's the little test function I wrote:
VBA Code:
Function TestArgs(p1, p2, p3)
Debug.Print Time & " p1 = '" & p1 & "', p2 = '" & p2 & "', p3 = '" & p3 & "'"
End Function
I tried calling it like this
=testargs(p1:=1, p2:=2, p3:=3)
, but Excel takes p1, p2, & p3 to be cell addresses and it gets an error. I tried renaming the parameters to something that cannot be a cell address, but I got the same error. Is this just a VB.Net feature?