I am trying to make a sum formula on a dynamic range. Much like in a pivot table.
Taking a look on the picture I want L15 to be the sum of the range from L16 to the blank row. As the range is dynamic I am not sure how to write it on my code. So far what I have is this:
If out.Range("A15").Cells(i, 1) = "Aktier" Then
out.Range("L15").Cells(i, 1) = Application.WorksheetFunction.Sum(Range("L15").Cells(i + 1, 1), Range("L15").Cells(i + 1, 1).End(xlDown))
End If
So my question is basically how do I write something like Sum(A1:End(xlDown))? :)
Hope you can help me out guys! :D
Thanks in advance!


out.Range("L15").Cells(i, 1).Value = Application.Sum(out.Range(out.Cells(i + 1, 12), out.Cells(i + 1, 12).End(xlDown)))- JvdVA15for "Aktier". Would be helpfull to know whativariable holds and what it does for you. - JvdV