Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Accessing a 'column' in a VB array

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 column (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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 200
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 column (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

Application.Index(tempArray, 0, 1)

Alan Beban
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to manipulate an 2D Array into a Column Array? Joe Excel Discussion (Misc queries) 3 April 16th 07 06:30 PM
Finding a number in a column out of an array in another column cirena Excel Discussion (Misc queries) 3 April 4th 07 06:30 PM
Type mismatch accessing variant array too many times peter Excel Programming 6 February 12th 05 10:07 PM
calculting stats of column array in 3D array [email protected] Excel Programming 0 February 4th 04 11:27 PM
accessing data from an array Tom Ogilvy Excel Programming 5 September 9th 03 04:21 AM


All times are GMT +1. The time now is 10:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"