C
Cliff
I'd like to write a function which accepts a list and
executes a for loop with operations on each element in
the list. I can't figure out how to get the size of the
list. For example, my call in an excel cell would be
=myfun(A1:A10)
and the VBA code is
Public Function myfun(data)
Dim idx As Integer
size = ???
For idx = 1 To size
... data(idx) ...
Next idx
How do I get the size of data (10 in this example)? It
would be nice if it worked for both horizontal and
vertical arrays, but I'll take either.
Thanks!
executes a for loop with operations on each element in
the list. I can't figure out how to get the size of the
list. For example, my call in an excel cell would be
=myfun(A1:A10)
and the VBA code is
Public Function myfun(data)
Dim idx As Integer
size = ???
For idx = 1 To size
... data(idx) ...
Next idx
How do I get the size of data (10 in this example)? It
would be nice if it worked for both horizontal and
vertical arrays, but I'll take either.
Thanks!