Can I redim an array that is held within an array?
I have (for example) 3 worksheets, and from each one I want to load 2 columns into an array.
However I also want (I think) those 3 arrays to be contained within one array so that I can step through them easily.
The code below will not run, but might better show what I am wanting;
const sources_qty As Long = 3
Dim source_arrays() as Variant ' the array to hold the others
Dim array1() as variant
Dim array2() as variant
Dim array3() as variant
Dim index as Long
Dim ws as Worksheet
' Assign the arrays into the 'grouping' array
ReDim source_arrays(sources_qty)
source_arrays(1)=array1
source_arrays(2)=array2
source_arrays(3)=array3
' Load the arrays from the sheets
for index = 1 to sources_qty
Set ws = ThisWorkbook.Worksheets(Choose(index,"MyFirst","MySecond","MyThird"))
' the line below should redim the array HELD in source_arrays(1) (ie. array1), to be the same size as the number of used rows on 'ws'
ReDim source_arrays(1)....... ? ws.usedrange.rows.count
next
'more code
I'm just not sure how to reference the array within an array in order to redim it, (if it is possible?)
thanks
Bookmarks