View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
merjet merjet is offline
external usenet poster
 
Posts: 812
Default 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