Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 49948

Tweak a 'column sum' macro

$
0
0
I have just found a 'column sum' macro that looks like it will work out for my situation exception for one small detail.
The macro is column-specific.

I would like to be able to sum columns on the fly.
That is, click on a cell in any column and then sum all the cells directly below that cell, including that cell (until the first blank cell encountered).

Here is the code I found:

Code:

lastrow = Cells(Rows.Count, 3).End(xlUp).Row
Cells(lastrow + 1, 3).Formula = "=sum(C1:C" & lastrow & ")"

Any tips would be appreciated. :)

Viewing all articles
Browse latest Browse all 49948

Trending Articles