Я пытаюсь установить диапазон в качестве переменной для итерации по различным столбцам в al oop. Я продолжаю получать 1004 Application-Definition или объектно-определенную ошибку.
Dim TC_Rng As Range
Dim TC_i As Integer
Dim Traces As Variant
DaysLeft = Range("B1")
Traces = Array("Min", "E75", "E50", "E25", "Max", "Deterministic")
TC_i = 100 'TC_i is the first column--the script needs to iterate from column 100 through 105
For Each Trace In Traces
Set TC_Rng = Range(Cells(4, TC_i), Cells(DaysLeft, TC_i))
'do the next steps of code
TC_i = TC_i + 1
Next Trace