Three Diminsional Array

W

wkbailey2

I am using a three dimensional array and trying to extract data from
the array into excel. Currently, I am using a For/Next Statement to
populate each excel cell seperately from the array. I am hoping to
find a more efficient way of accomplishing this.

For example, if the array has 600 rows and 10 columns and the third
diminsion is 20.

I am trying to copy all the rows (1-600) and all the columns (1-10)
from the third diminsion equal to 1 onto the excel worksheet. And
then repeat the process for the next third diminsion.

I tried selecting Array(1 to 600, 1 to 10,1), but that did not work.

I am a bit of a newbie here, so any help would be appreciated.
 
R

RB Smissaert

Fastest way is probably to put the data in a 2-D array first and then assign
that 2-D array to a range in one go.
So loop through your 3-D array, values to 2-D array and then for example
Range(Cells(1), Cells(20, 20)) = Array.

RBS
 
W

wkbailey2

Beautiful. Much faster.

Fastest way is probably to put the data in a 2-D array first and then assign
that 2-D array to a range in one go.
So loop through your 3-D array, values to 2-D array and then for example
Range(Cells(1), Cells(20, 20)) = Array.

RBS










- Show quoted text -
 

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

Top