Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extract a part of two dimensional array into a single dimensional one

Status
Not open for further replies.

Faheemi

Programmer
Sep 2, 2001
59
HK
Hi there,

I want to extract a column of a two dimensional array into a single dimensional array.

Say a two dimensional array

1 | abc
2 | xxx
3 | www
4 | qqq
5 | sss

I want to extract just the second column into a single dimensional array

Thanks for your help

Faheem Hameed
 
Does this do what you want?

Dim arrayTwo(3,3)
Dim arrayOne(3)

For i = 0 to 3
For j = 0 to 3
arrayTwo(i,j) = i & "," & j
next ' j
next ' i

For k = 0 to 3
arrayOne(k) = arrayTwo(0,k)
s = s & vbcrlf & arrayOne(k)
next

msgbox s
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top