Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referring to multiple elements of an array (VB)
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referring to multiple elements of an array (VB)
Pete, thanks for the insight. Combining the "index" function with
dynamic arrays did the trick. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Use formulas for array elements | Excel Discussion (Misc queries) | |||
Reference Elements w/in an Array | Excel Discussion (Misc queries) | |||
Non-unique elements in an array | Excel Discussion (Misc queries) | |||
Number of elements in an array | Excel Programming | |||
Shifting Array Elements | Excel Programming |