View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Referring to multiple elements of an array (VB)

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

"Phil" wrote in message
oups.com...
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