Hi -
I'm trying to declare multiple dynamic arrays, with each dynamic array having the same dimensions.
(I'm taking data from two separate sheets that have the same dimensions but different values, and want to subtract one from the other).
So Array1 has two dimensions of unspecified size
and Array2 has two dimensions of the same unspecified size.
I would think the declaration would be Dim Array(2)() as Variant (or whatever)
Another option would be to declare a 3 dimensional array, Dim Array(2,,)
I found these examples in the MSDN VBA guide. But I get a compile error when declaring these. From reading through a bunch of threads, it seems that this has something to do with the difference between VBA.net and VBA for Excel (I'm using the latter). Why there are two different types of VBA from the same company that don't recognize the same code, I have no idea. I'll chalk that up to yet another way Microsoft makes people's lives miserable.
So any help would be appreciated. How do I declare an sequence of 2-dimensional arrays - Array1,Array2,Array3 -
Where Array(1)(1,1) = the first cell in the array1
and Array(2)(1,2) = the first cell in array2
But important note, I don't know in advance the dimensions of the arrays, I only know I need 2 (or more) of them, all with the same dimensions but different values.
Thanks for any help.
Dave
Bookmarks