Hello,

I have the following script:

For i = 1 To nrFTE 
    For j = 0 To nrCat 
        maxRow = Range("AB7").Offset(nrAtt, 0).Row 
        totform = "=SUM(AB7:AB" & maxRow - 1 & ")" 
        Range("AB" & nrAtt + 7).Offset(0, (i - 1)) = totform 
    Next 
Next
All I want to do is to set the column as a variable in the SUM formula...practically I want to have a variable number of sums in which the column changes (ex. AB7:AB23, AC7:AC32, AD7:AD32, etc.).

Any ideas?

Thank you for your support!