RDB,
unless you change Rory's formula to something like
=SUM(OFFSET(D2;0;0;COUNTA(
If you are familiar with VBA macros, i would suggest a coding like the following:
Sub FlexSum()
Dim SumCell As String
Dim SumCellRow, SumCellCol, LastRow, LastCol As Integer
SumCell = "A1"
SumCellRow = Range(SumCell).Row
SumCellCol = Range(SumCell).Column
LastRow = Range("d" & ActiveSheet.Rows.Count).En
LastCol = Cells(2, ActiveSheet.Columns.Count)
Range(SumCell).FormulaR1C1
End Sub
This code will find the last non-empty cell of column D, then find the last non-empty cell in row 2 and insert a Sum formula into a specified cell. To specify this cell, just replace the "A1" in the 4th line of my code to your prefered cell.
Best,
Exciter
Main Topics
Browse All Topics





by: roryaPosted on 2007-10-26 at 08:40:08ID: 20156524
You could use OFFSET:
=SUM(OFFSET($D$2,0,0,6,2))
Regards,
Rory