View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
JUAN JUAN is offline
external usenet poster
 
Posts: 39
Default First empty row after last used row

Hello Mudraker,
Thanks, FYI, this part of the code
Cells(r, "c").FormulaR1C1 = "=sum(c1:c" & r - 1 & ")"
didn't work property but I figured out and fixed it.
Here's what I came with and works fine:
Cells(r, "c").Value = "=sum(c1:c" & r - 1 & ")"

Thanks for your great help and also all of the rest of you
who provided me with options.

Juan
-----Original Message-----
Sub ss()
Dim r As Long
r = Cells.Find(what:="*", SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row + 1
' format range as required
'Range("a" & r & ":o" & r).Select
'Selection.Font.Bold = True
Range("a" & r & ":o" & r).Font.Bold = True
Cells(r, "a").Value = "Total"
Cells(r, "c").FormulaR1C1 = "=sum(c1:c" & r - 1 & ")"
End Sub


---
Message posted from http://www.ExcelForum.com/

.