Thread
:
Summing until empty cell
View Single Post
#
2
Posted to microsoft.public.excel.programming
Crowbar via OfficeKB.com
external usenet poster
Posts: 128
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
Reply With Quote
Crowbar via OfficeKB.com
View Public Profile
Find all posts by Crowbar via OfficeKB.com