Hi,
I've been using something I learned (probably here), but don't really understand what's going on.
I read ranges into a variable with the following:
Dim
mValues As Object(,) = _CType(Globals.Sheet1.Range(Cell(r1, c1), Cell(r2,c2)).Value, Object(,))
Where I use "Cell" to save typing:
Private Shared Function Cell(ByVal Row As Integer, ByVal Column As Integer) _
As Excel.Range
Return CType(Globals.sheet1.Cells.Item(Row, Column), Excel.Range)
End Function
This works tremendously faster than reading in values cell by cell. When I do this, however, mValues becomes a 1-based array. First, I don't understand what's going on that would make that happen. Second, I didn't think you could have 1-based arrays!
Can anyone give me some insight as to what's going on here
-------------
Some related questions --
Can I change this 1-based array into a 0-based array without the overhead of copying each element from one array to the other
It would often be convenient to have a 1-dim array containing a row of the 2-dim array. Is there a fast way to make this assignment That is, is there something that would be faster than copying each element for some row over Or perhaps is there a way to pass one row of the 2-dim array as an argument
I'd appreciate any insight or suggestions.
Thanks