how to set current cell (variable row) to sum values of all cells above
Sub Sums()
Dim iEnd As Integer
Dim iCol As Integer
iCol = ActiveCell.Column
iEnd = Cells(1, iCol).End(xlDown).Row
Cells(iEnd + 1, iCol).Formula = "=SUM(" & Cells(1, iCol).Address _
& ":" & Cells(iEnd, iCol).Address & ")"
End Sub
Hth,
Merjet
|