excel - column to matrix VBA -


i need reformat single column (range) of 100+ thousand integers user defined matrix of rows , columns. online searches have been disappointing in they're complicated or not need. index , offsets won't due because matrix dimensions (300+ cols, 300+ rows) prohibitive copying on , down. function sufficient includes range index, num_cols, num_rows.

thanks in advance.

so assuming understand question (and if not withdraw answer, let me know), following entered array formula in spot want answer land should work. inputcol data sit. not checking sizes , such. may soup that. if indeed want, can make little better copying row (using application.worksheetfunction.transpose) @ time (though suspect gets offset , less readability).

function sotest(byref inputcol range, numrows long, numcols long) variant     dim newmatrix() variant     dim i, j, k long     redim newmatrix(1 numrows, 1 numcols)     k = 1     = 1 numrows      j = 1 numcols        newmatrix(i, j) = inputcol(k, 1)        k = k + 1      next j     next     sotest = newmatrix end function 

Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -