Hi
I will try to do better.
What Am I Doing
I have a sheet with about 70,000 rows which I need to manipulate and compare with other data using existing VBA routines.
The sheet is read into a 2-dimensional variant array where it is manipulated, lines sometimes added, and written back to the sheet.
The statements for reading the sheet into the array is:
vartable = application.worksheetfunction.transpose(range("A1:AB<last used row>")
This operates nearly instantly and is very much faster than reading the data in one cell at a time.
The data needs to be "transposed" because the number of rows may change and you can only Redim Preserve the last dimension of an array (thus it needs to be varTable(col, row)).
As soon as the sheet grew to more than 65536 rows, this stopped to work and instead of loading all the rows into the variant array, it only loaded <last used row> mod 2^16 rows.
Examples
rows on sheet rows loaded
65535 65535
65536 65536
65537 1
65538 2
...
I have found no documentation as a feature/aspect of the .transpose function.
I suspect it to be a bug left from the transistion of 2003 to 2007; and that somewhere inside Excel or VBA, a 16-bit integer is being used where a 32-bit long should be used.
My question is: is this an aspect? if a bug, is it ever likely to be fixed?
are we doomed to loading arrays larger than 65536 lines one cell at a time?
The workaround (e.g. if this technology didn't exist, what would you do) is obvious; the question is why this technology breaks down and is there a documented limit that says this is what to expect.
?
enuf?
david