Основываясь на примере, который я нашел на этом сайте, я сделал следующую процедуру. Он печатает только первый элемент массива во всем диапазоне вместо печати каждого элемента в каждую ячейку диапазона. Ты хоть представляешь, что я делаю не так?
Спасибо,
Крах
i = 2
Do Until Cells(i, 1) = "" 'loops through IDs in 1st column of spreadsheet
If Cells(i, 1) > "" Then 'if it finds an ID
GoSub CommentsColor 'sub that calculates a color -> thisColor
End If
ReDim Preserve colors(i - 2) 'start array at zero
colors(i - 2) = thisColor 'populate array
thisColor = "" 'clear variable
i = i + 1 'go to next ID in 1st column of spreadsheet
Loop
'set range
Set colorData = ActiveWorkbook.Worksheets("Movement_Data").Range(Cells(2, thisCol), Cells(i - 1, thisCol))
colorData.Value = colors 'print array to worksheet