Of course, but it'll cost you a ticket to the olympics
Sub MyReallyCoolSumSubRoutine()
Dim FirstCell As Range
Set FirstCell = ActiveSheet.Range(Cells(1, ActiveCell.Column).Address & ":" & ActiveCell.Offset(-1, 0).Address).Find(What:="", LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlPrevious, _
MatchCase:=False, SearchFormat:=False)
ActiveCell.Formula = "=SUM(" & FirstCell.Offset(1, 0).Address & ":" & ActiveCell.Offset(-1, 0).Address & ")"
End Sub
It's a little different, because you have to start the search 1 cell above. In this case when the search is running the active cell is empty. Be careful when you run the macro, the active cell can't be in the first row, or you get an error.
Bookmarks