Referring to multiple elements of an array (VB)

P

Phil

Hi, is there a way to refer to multiple elements of an array in a
single instruction, without of course having to loop through the array?
Like in Matlab where one could, for example, refer to first "n"
elements of the second column of an array simply using:
array_example(1:n,2).
thnx for help,

Phil
 
P

Peter T

Hi Phil

You could take assign a horizontal or vertical slice of an array to a
variant

va = application.index(myArray, row)
va = application.index(myArray, ,col)

But I don't know any way to directly refer to a segment of an array's row or
column, I don't think possible.

I'm not sure this index method would be any quicker than looping, I suspect
not. Also would error in xl2000 if total number of elements exceeds 5461

Regards,
Peter T
 
P

Phil

Pete, thanks for the insight. Combining the "index" function with
dynamic arrays did the trick.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top