View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Last cell in new formula

Thanks for the feedback. Try

Dim lngLastRow As Long
lngLastRow = Worksheets("sheet1").Cells(Rows.Count, "N").End(xlUp).Row

Range("N" & lngLastRow + 1).Formula = _
"=Sumproduct((N8:N" & lngLastRow & "=0)*(N8:N" & lngLastRow & "<=1000))"

--
Jacob


"wynand" wrote:

THANKS GUYS, BOTH WORK PERFECT!

If I would like the "b2" result to be always be under the last cell e.g.
N16, what would you suggest

"