PDA

View Full Version : Solved: moving array to worksheet



skatastic
06-20-2010, 08:51 AM
I have an array that is not uniform size that I need to copy to the worksheet. I want to copy it over at once as a range for speed sake.

I'm using cells(1,1).resize(imaxrow,imaxcol).value=myarray
this command leaves the data starting in b2 and it cuts off the last row and column

the latter problem is easy as i just change the resize to (imaxrow+1,imaxcol+1)
but I just can't figure out how to get the array to start in A1.

if i do cells(1,1)=myarray(1,1) it works so if necessary I can use loops and import my array one cell at a time but that will just make it slower so I don't want to resort to that.

skatastic
06-20-2010, 09:28 AM
i figured it out.... i had done
redim myarray(imaxrow,imaxcol)

what i needed to do is
redim myarray(1 to imaxrow, 1 to imaxcol)