View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Crowbar via OfficeKB.com Crowbar via OfficeKB.com is offline
external usenet poster
 
Posts: 128
Default Summing until empty cell

This will work, its set up to look in column C, from Row 6 to find a empty
cell. Once an empty cell is found it will put in your autosum for that range.

If you need further assistance I can send you an example workbook




Sub Macro1()

Dim LastRow
LastRow = Sheet1.UsedRange.Row + 1 _
+ Sheet1.UsedRange.Rows.Count


For x = 6 To LastRow

If Sheet1.Cells(x, 3).Value = "" Then

Range("C" & x).FormulaR1C1 = "=SUM(R[-" & x - 1 & "]C:R[-1]C)"

Exit For
End If
Next

End Sub

--
Message posted via
http://www.officekb.com