I'm trying to paste the dynamic array OutputArray to the worksheet starting in cell Q8 which I've given the name UniqueEntitiesOutput
The code then populates OutputArray and I now want to paste it to the worksheet
Here I've used select just so that you can see on the screenshot that I am telling it to use the intended range
What's the result? (see 2nd screenshot)
It's outputting a column of blanks in Q (whereas it should be outputting 1st column of the array)
It's outputting the 1st column of the array in R (whereas it should be outputting 2nd column of the array)
It's outputting the 2nd column of the array in S (whereas it should be outputting 3rd column of the array)
It's not doing anything with the 3rd column of the array
Yet if I look at the Immediates window, the array is holding data the way I was expecting it to
?OutputArray(1,1)
Aviva plc
?OutputArray(1,2)
AV.
?OutputArray(1,3)
1
So why isn't it pasting the 3 columns of the array starting in column Q?
Thanks
VBA Code:
ReDim OutputArray(1 To UniqueOutputs, 3)
Here I've used select just so that you can see on the screenshot that I am telling it to use the intended range
VBA Code:
Range("UniqueEntitiesOutput").Resize(UBound(OutputArray, 1), 3).Select
Selection = OutputArray
What's the result? (see 2nd screenshot)
It's outputting a column of blanks in Q (whereas it should be outputting 1st column of the array)
It's outputting the 1st column of the array in R (whereas it should be outputting 2nd column of the array)
It's outputting the 2nd column of the array in S (whereas it should be outputting 3rd column of the array)
It's not doing anything with the 3rd column of the array
Yet if I look at the Immediates window, the array is holding data the way I was expecting it to
?OutputArray(1,1)
Aviva plc
?OutputArray(1,2)
AV.
?OutputArray(1,3)
1
So why isn't it pasting the 3 columns of the array starting in column Q?
Thanks
Attachments
Last edited: