Reputation: 79
I have declared a variant variable in my VBA code, which takes on values from a range. E.g.
Dim Output as variant
Output = Range("A1:Z1").value
I have declared another array of variants.
Dim OutputArray(10000) as variant
Each item in this array is an iteration of Output; i.e. OutputArray(0) is the value of Output in the first iteration, OutputArray(1) is the value of Output in the second iteration and so on.
I have two questions:
How can I extract individual items from OutputArray; e.g. I want to know the value of cell C1 in 27th iteration?
How can I paste the entire array OutputArray on a worksheet in one go? If it is not possible to do so in one go, what's the best option I have?
Thanks in advance!
Upvotes: 0
Views: 203
Reputation: 60174
To return C1 on the 27th iteration, it will be something like
OutputArray(26)(1,3)
I think you will have to paste each iteration separately
R = outputArray(iteration_num)
Upvotes: 3