Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro sum
Hi, i need a macro to sum every nea range and display result to the next cell
in the last row in colum "L". Ex: L M total sum 15 2 8 25 total 7 7 5 19 I need a macro to sum only range that doesn't have a sum at the last row/next cell. I need macro to sum below total and to add sum. the problem is that i allways add entries, so it will not be a range, so i need to sum the last entries below total. Can this be done? Thanks! |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro sum
Sub getsubtotalsSAS() mc = "L" lr = Cells(Rows.Count, mc).End(xlUp).Row + 1 For i = 2 To lr If IsNumeric(Cells(i, mc)) Then msum = msum + Cells(i, mc) If LCase(Cells(i, mc)) = "total" Or Cells(i, mc) = "" Then Cells(i, mc).Offset(-1, 1) = msum msum = 0 End If Next i End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "puiuluipui" wrote in message ... Hi, i need a macro to sum every nea range and display result to the next cell in the last row in colum "L". Ex: L M total sum 15 2 8 25 total 7 7 5 19 I need a macro to sum only range that doesn't have a sum at the last row/next cell. I need macro to sum below total and to add sum. the problem is that i allways add entries, so it will not be a range, so i need to sum the last entries below total. Can this be done? Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
using a cell value to control a counter inside a macro and displaying macro value | Excel Worksheet Functions | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) |