Sum up a dynamic range
lastrow = Columns("A:A").Find("*", [A1], , , xlByRows, xlPrevious).Row
Range("A" & lastrow+1).formula="=SUM(A1:A" & lastrow & ")"
Regards,
Stefi
€˛Peter€¯ ezt Ć*rta:
Dear all,
I want to create a function (maybe just a common IW question in fact) to sum
up a column, which have a dynamic number of rows!
My user will retrieve data from DB and display in a column, but the number
of row of this column is subjected to change, so I can't hardcode
"=SUM(A1:A10)" at the end of the column. So I'd like to know how I can sum
and display the total right after the last cell of that dynamic column?
Thanks,
|