Public Sub LoadArray()
Dim A(1000000, 2) As Long
Dim OneD_A() As Long
Dim I As Long
For I = 0 To 1000000
A(I, 0) = I
A(I, 1) = I + 1000000
A(I, 2) = I + 2000000
Next I
OneD_A = GetColumn(A, 2)
MsgBox OneD_A(400)
End Sub
[code]
build a function to return a column (or row depends on your interpretation)
[code]
Public Function GetColumn(A() As Long, intCol As Integer) As Long()
Dim I As Long
Dim tempArr() As Long
ReDim tempArr(UBound(A))
For I = LBound(A) To UBound(A)
tempArr(I) = A(I, intCol)
Next
GetColumn = tempArr
End Function
[code]
If your number of dimensions was beyond 2 or if your second dimension is large then you might consider another data structure. You may want to look at jagged arrays. Arrays are not internally stored with "rows" and "columns". So even if it they exposed a means to get one of the dimensions, that function would still have to iterate the array.
Languages like VB.net provides lots of different data structures such as collections, heaps, ordered arrays, lists, dictionaries...
Efficiency really depends on how you use it and which one to choose. There is a trade off between Sorting, adding, removing, and finding. There is not one structure that is best. For example determining if an item exists in a dictionary is very efficient compared to an array. But adding to a sorted list or a dictionary requires overhead as compared to an array.