Array to Worksheets

  • Thread starter Thread starter Paul W Smith
  • Start date Start date
P

Paul W Smith

Is there a quick way of outputting the contents of an array to a worksheet
without having to iterate through all the rows and columns?

I am think of the opposite of :

Array = Range("A1").CurrentRegion
 
I am think of the opposite of :
Array = Range("A1").CurrentRegion

exactly:
For a 2D array:

rw = Ubound(array,1) - lbound(array,1) + 1
col = Ubound(array,2) - lbound(array,2) + 1
range("A1").Resize(rw,col).Value = array

if it is a 1D array

col = Ubound(array,1) - lbound(array,1) + 1
Range("A1").Resize(1,col).Value = Array

or to put it horizontal

rw = Ubound(array,1) - lbound(array,1) + 1
Range("A1").Resize(rw,1).Value = Application.Transpose(Array)

In xl2000 and earlier, use of transpose restrict the number of array
elements to 5461.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top