View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
PatFinegan[_3_] PatFinegan[_3_] is offline
external usenet poster
 
Posts: 1
Default data transfer between VBA arrays

Redim Preserve works great on the last dimension of an array, but if I
want to change a 2x2 array to a 3x3 array, leaving the 2x2 data intact,
I've had to:

1. transfer all the data to a temporary 3x3 array using "for" loops;
2. redim the orginal array to 3x3;
3. repopulate the original array with another set of "for" loops; &
4. clear the temporary array (redim array(0)).

Question: Is there a faster means? The actual arrays have several
million elements each.

For example, is there a way to "set" the original array equal to the
temporary array after step 1? Or is there a way to "rename" the
temporary array dynamically so that the code thinks it's the original
array? Or any other idea whatsoever. Thanks in advance.:)


---
Message posted from http://www.ExcelForum.com/