View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Mike Mike is offline
external usenet poster
 
Posts: 3,101
Default add sum with macro to list

Try this will sum A2 to last row
With Worksheets("Sheet1")
If IsEmpty(.Cells(.Rows.Count, 1)) Then
With .Cells(.Rows.Count, 1).End(xlUp)
.Offset(2, 0).Formula = "=Sum($A$2:" & _
.Address & ")"
End With
End If
End With

"mohavv" wrote:

Hi,

How can I add a SUM function via a macro underneath a list which can
differ in length.
I know how to get to the bottom of the list using CTRL-DOWN in
"relative mode" but then I get into trouble with the range in the
formula.

Any help on this is welcome.

Cheers,

Harold