Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Code and Summing Next Non-Blank Cell in Column
I am using the code below to place a sum subtotal of values in Column V
whenever there is blank cell in Column U. The macro provides the correct result but as the sheet has over 20,000 entries the macro takes about 10 minutes to complete. Is there a more time efficient (or non-VBA) way to provide the same result? Thanks Sub test() 'place a subtotal in column(V) wherever column(U) has a blank cell lrow = Range("u65536").End(xlUp).Row + 1 For Each cell In Range("u2:U" & 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Keep the first cell when summing a column? | Excel Discussion (Misc queries) | |||
Summing a column based on the length of text in a cell in anothercolumn | Excel Worksheet Functions | |||
Summing a column based on input in a cell | Excel Discussion (Misc queries) | |||
Summing (or counting) cells until there is a blank cell | Excel Discussion (Misc queries) | |||
Summing every other cell in a column? | Excel Worksheet Functions |