Dim HighScoreOneHourData() As Integer
Dim HighScoreOneHourDates() As String
ReDim HighScoreOneHourData(1 To UBound(SA, 1) - 3)
ReDim HighScoreOneHourDates(1 To UBound(SA, 1) - 3)
For j = 4 To UBound(SA, 1)
HighScoreOneHourData(j - 3) = CInt(Val(SA(j, PositionInArray + DataColumn + 2)))
HighScoreOneHourDates(j - 3) = SA(j, 1)
Next j
SortSheet.Range("A1:A" & UBound(HighScoreOneHourDates)) = HighScoreOneHourDates
SortSheet.Range("B1:B" & UBound(HighScoreOneHourData)) = HighScoreOneHourData
When these last two lines in the example above are executed all the cells in the sheets are filled with the first element from the arrays.
HighScoreOneHourDates is an array filled with consecutive dates. Still only the first date is printed to the sheet.
I've stopped the code and checked the state of the arrays and the they are correctly filled.
Anyone knows why the cells are filled with the first element?
ReDim HighScoreOneHourData(1 To UBound(SA, 1) - 3) ReDim HighScoreOneHourDates(1 To UBound(SA, 1) - 3)