View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default End(xlDown) function

Function LastRowNum()
Application.Volatile
Set r = Range(Application.Caller.Address)
LastRowNum = r.End(xlDown).Row
End Function

--
Gary''s Student - gsnu200852


"John" wrote:

I have the following function to return the last row number in a column of
numbers:

Function LastRowNum()
Application.Volatile
LastRowNum = ActiveCell.End(xlDown).Row
End Function

Problem, I want it to return the last row number starting from the cell the
function is in, not starting from the active cell. ActiveCell obviously has
to come out, but what do I replace it with?