• 5 Subscribers

In Excel VBA, I understand how to use ParamArray() but is there a way to require sets of parameters instead of just one at a time. For example; sum(val1, val2, val3, ...) lets you enter one value at a time, but with sumifs(A:A, rng1, val1, rng2, val2, ...) you are required to put the rng and val as a set. Is there a way to do that with user defined functions?

I feel like it is just something I will need to do in the code but I would like it to correct from the start.

Function foo(bar As String, ParamArray names() As String, ParamArray attributs() As Range) As String
End Function

in the cell

=foo("hello", "name", A2:A5, "age", B2:B5, "address", C2:C5)

0 answers in total

Answer this questsion