Paasing Values from one Array to another

G

Guest

hi there,

I am running a spreadsheet model which generates 100's of result values.

I have written code to run the model for 50 different sets of inputs,
therefore I have 50 different sets of results.

I have created an array called EngineIRPA which I populate with these
results...say for simplicity it is a 5x5 array.

Now I want to pass the values in the EngineIRPA array to another Array
called Results which will be big enough to hold the results of all 50 runs ie
50 x 5x5 values (say the array is 50x25). I will then write these values to a
separate worksheet called results...

so for example I want to write the 1st row of values in EngineIRPA to the
first 5 'spaces' in Results (ie row 1 columns 1 to 5) and then I want to
write the 2nd row of values in EngineIRPA to the second block of 5 spaces in
Results (ie row 1 columns 5 to 10)....then when I recalculate with new inputs
I will pass the new results to EngineIRPA, retain the current values in
Results and then append Results with the next set of values from
EngineIRPA...

does this make sense what I'm trying to do??

I have it working with passing a single value between the arrays eg

Results(x,1) = EngineIRPA(1,1) but I cannot seem to pass blocks of data...

The 'x' above is the counter which runs each set of inputs through a model.
I could just record a macro which c&ps the values, however I would like to
use arrays avoid multiple read/writes and speed up the model.

Cheers
 
J

Jim Rech

I am not able to follow exactly what you want to do but

I'm not sure if that's a slip of the keyboard but, in case it isn't, you
must pass one item at a time into an array. You cannot set blocks in an
array all at once.
 
A

Alan Beban

Sorry to be so delinquent in responding, but I had misplaced my files.

You might want to consider making available to your workbook the
functions in the freely downloadable file at http://home.pacbell.net/beban.

There is a function SubArray that will return any rectangular chunk of
an array, and another, ReplaceSubArray, that will replace any
rectangular chunk of an array with a similar sized chunk of another array.

It sounds like the combination of those two would accomplish what you
are describing.

Alan Beban
 

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