This is an odd one.
In the below code, when I try to output an array (DateArray) into a vertical range (OutputRange), the first value of the array is just repeated over and over, like so:
01/01/2013
01/01/2013
01/01/2013
01/01/2013
01/01/2013
01/01/2013
However, this is not the case if I output the array to a horizontal range. Can anyone help me understand why this is the case?
In the below code, when I try to output an array (DateArray) into a vertical range (OutputRange), the first value of the array is just repeated over and over, like so:
01/01/2013
01/01/2013
01/01/2013
01/01/2013
01/01/2013
01/01/2013
However, this is not the case if I output the array to a horizontal range. Can anyone help me understand why this is the case?
Code:
Set Dates = Range(Cells(11, 3), Cells(LastDate, 3))
For i = 1 To Dates.Rows.Count
DelData.Add Dates(i, 1).Value, 1
Next i
DateArray = DelData.Keys
shtCodes.Activate
Set OutputRange = Range("Y10", Cells(10 + (Dates.Rows.Count), 25)) 'vertical output range
'Set OutputRange = Range("Y10", Cells(10, 25 + (Dates.Rows.Count))) 'horizontal outputrange works fine!
OutputRange = DateArray