View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
jindon[_55_] jindon[_55_] is offline
external usenet poster
 
Posts: 1
Default Accessing a 'column' in a VB array


den1s Wrote:
In VB, how does one access an entire column or row. Let's say I have a
5x2 array and I would like to access all the data in the 1 colum
(i.e.

(1,1 2,1 3,1 4,1 5,1).

So given a variable defined as,


tempArray(1 To 2, 1 To 5) As Double


how could I access all the 1's column?


I know in Matlab I could use the command,


tempArray(:,1)


not sure the equivalent in Excel.


- Kwaj

Try something like

Code
-------------------

Dim i As Integer
For i = LBound(tempArray,2) To UBound(tempArray,2)
MsgBox tempArray(2, i)
Next

-------------------

--
jindo
-----------------------------------------------------------------------
jindon's Profile: http://www.excelforum.com/member.php...fo&userid=1313
View this thread: http://www.excelforum.com/showthread.php?threadid=55173