Macro that sums cells in rows of varible number and....
give this a shot
Sub test()
'place a subtotal in column(J) wherever column(I) has a blank cell
lrow = Range("i65536").End(xlUp).Row + 1
For Each cell In Range("i8:i" & lrow)
If cell.Value = isblank Then
cell.Offset(0, 1).Formula = "=SUM(R[" & -rowcount &
"]C[-1]:R[-1]C[-1])"
rowcount = 0
Else
rowcount = rowcount + 1
End If
Next
End Sub
"blazzzercat" <u30352@uwe wrote in message news:6b0307dd832cf@uwe...
I need a macro that will SUM the cells in rows that vary in the number of
rows and put the total in the column next to the last number before a
blank
row. It will then go down the column until it finds another row with a
number
in it and SUM those rows until the next blank row, loop until no more rows
with numbers are found. The cells always start in I-8. I need the totals
in
column J.
Thanks so much in advance.
|