First off I would say this only viable given you're using XL2007 - in earlier versions you were limited to 256 columns and given your real 1044x1044 matrix could theoretically need to be transposed into one row you would not be able to do this.
I would say first off that whether you opt for VBA or formulae you're best bet will be to first store your matrix in a vector ... eg using example of A1:F6 you create a vector of A1:A36 on another sheet, it will I think be much easier to work with the vector to create the final matrix than with the original matrix ... ie you could achieve this with formulae...
If you were to create vector impression of initial matrix on Sheet2 where initial matrix Sheet1!A1:F6 like so:
And we were then to recreate matrix per row requirement of user, say on Sheet3 then with row requirement entered into A1 (and validated such that it is indeed a multiple of the rows in the vector) then
we can in turn create the requisite matrix using:
I confess I've not tested this out on a large matrix and I suspect performance would be poor and would warrant VBA but I just wanted to illustrate that by using a vector things become a little simpler.
In VBA terms it would I think be simply a case of iterating the vector, selecting the range of values to be copied from the vector and pasting into next blank row on results tab, something like:
the above utilising the Change event on cell A1 such that when A1 is altered the matrix repopulates.
I've attached a file which illustrates all of the above - given this is only viable in XL2007 it is .xlsm format
Bookmarks