Sum a Range
Public Sub SumRangeTest()
Dim aRange As Range
With ActiveCell
Set aRange = Range(.Offset(1), .Offset(1).End(xlDown))
.Formula = "=SUM(" & aRange.Address(RowAbsolute:=False,ColumnAbsolute:=False) & ")"
.Copy Destination:=Range(.Cells(1), .Offset(1).End(xlToRight).Offset(-1))
End With
End Sub
Related examples in the same category