View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Setting a sum formula

Try this

EndRow = TargetSheet.Range("A" & Rows.Count).End(xlUp).Row
If EndRow 1 Or Range("A1").Value < "" Then
Cels(EndRow+1, "A").Formula = "=SUM(A1:A" & EndCell.Row & ")"
End If

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mike" wrote in message
...
I have the following code:

Set EndRow = TargetSheet.Range("A1", TargetSheet.Range("A65536").End
(xlUp).Address)
ListRow = EndRow.Row + EndRow.Rows.Count

What I am trying to do is determine the last row of data on a sheet, go to
the cell right below it, and sum up everything above it. The number of

rows
will always be different. Please help. Thanks.