Hi All,
I'm trying to create a dynamic array based on the number of populated rows.
I would then like to loop through the column and populate each element with that cells value.
So for examlpe;
Row # Value
1 10
2 19
3 22
4 6
5 12
Id what the array to have 2 dimensions to hold the row number and the value
what I have tried to do this first I count the number of rows:
i = Application.WorksheetFunction.CountA(myRange)
next I want the value of i to be the length of the array
Dim MyArray(i, 3) as Long
doesn't work - if I enter a number into i it does but then it not dependent on how many rows there are?
Any pointers in the right direction will be appreciated.
I'm trying to create a dynamic array based on the number of populated rows.
I would then like to loop through the column and populate each element with that cells value.
So for examlpe;
Row # Value
1 10
2 19
3 22
4 6
5 12
Id what the array to have 2 dimensions to hold the row number and the value
what I have tried to do this first I count the number of rows:
i = Application.WorksheetFunction.CountA(myRange)
next I want the value of i to be the length of the array
Dim MyArray(i, 3) as Long
doesn't work - if I enter a number into i it does but then it not dependent on how many rows there are?
Any pointers in the right direction will be appreciated.