I have a function that takes in a ParamArray
that I'm trying to pass an unknown number of parameters into. I'm looping through rows and passing in numbers based on if the cells are empty or not, but it seems like I have to pass in each number as its own argument. I tried putting the numbers into an array and passing that, but it just ended up being an array of an array in the function and not working properly. Is there a way to do this?
Ex:
Dim myarray() as double
Function test(ParamArray arg() as Variant) as Single
'function does stuff with arg(s)
End Function
For Each cell in [somerange]
If cell <> "" then
'save cell value into an myarray?
End If
Next
'want to pass those saved values into function
Call test(myarray)
Edit: I kind of found a workaround. I realized I can pass a range into the function so I'm just going to create a temporary range and pass that in.