EXCEL VBA Calculation loop
===

So far I've managed to create a search feature that scans a column and collect rows in an Array. Then I print the array in another sheet to form a table. I do this with a number of criteria which means that I get different arrays with different sizes.

For my problem. I want to do a calculation for each Row. `ActiveCell.FormulaR1C1 =" = TRUNC ((RC [-5], RC [-1]) / 7) "`. How do I make a loop that adapts to how many lines there are. There are also gaps in some places.

Here is an example for how one array is printed:

    For i = 1 To nS - 1
            Sheets("DataSheet").Select
            Union(Sheets("raw_list").Cells(arrStart(i), NameCol), Sheets("raw_list").Cells(arrStart(i), PhaseCol), Sheets("raw_list").Cells(arrStart(i), ToStartCol), Sheets("raw_list").Cells(arrStart(i), ToDefineCol), Sheets("raw_list").Cells(arrStart(i), ToMeasureCol), Sheets("raw_list").Cells(arrStart(i), ToAnalyseCol), Sheets("raw_list").Cells(arrStart(i), ToImproveDevCol), Sheets("raw_list").Cells(arrStart(i), ToImproveIndCol), Sheets("raw_list").Cells(arrStart(i), ToControlCol), Sheets("raw_list").Cells(arrStart(i), ToClosedCol)).Copy
            Cells(r, 1).Select
            ActiveSheet.Paste
            With Selection.Interior
                .Pattern = xlNone
                .TintAndShade = 0
                .PatternTintAndShade = 0
            End With
            r = r + 1
        Next

Thankful for any help!