View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
mudraker[_188_] mudraker[_188_] is offline
external usenet poster
 
Posts: 1
Default First empty row after last used row

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 Su

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