Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro that sums cells in rows of varible number and....
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro that sums cells in rows of varible number and....
Thanks Jef....works good.
Jef Gorbach wrote: 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 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 [quoted text clipped - 4 lines] Thanks so much in advance. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200612/1 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding sums in rows and columns and colouring cells with condition | Excel Discussion (Misc queries) | |||
Fill Cells with same number in three rows then skip to next number | Excel Worksheet Functions | |||
formula that sums cells yet does not round the number up or down. | Excel Worksheet Functions | |||
Setting varible to equal values of a # of cells | Excel Programming | |||
Excel VBA - Varible number rows | Excel Programming |