View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tim Barlow Tim Barlow is offline
external usenet poster
 
Posts: 34
Default Find last used row in Range with Data above and below.

Casey,

A few suggestions:

lastRow = Range("D19").End(xlDown).Row
If lastRow 1000 Then lastRow = 19

or

lastRow = Range("D1001").End(xlUp).Row
If lastRow 19 Then lastRow = 19

or

lastRow = 18 + Application.CountA(Range("D19:D1000"))


HTH

Tim

"Casey" wrote in
message ...

Hi,
I have a named range of cells D19:D1000 (EntryAreaProposal). There is
data above this range and below this range. I want to find the last
used row within this range and of course if I use something like:

LastRow = wks2.Cells(Rows.Count, "D").End(xlUp).Row

it hits the data below my range and give me "that" last row instead of
what I need. I know this has to be simple, but it's worn me out trying
to find something in the archives.
Help please.


--
Casey


------------------------------------------------------------------------
Casey's Profile:

http://www.excelforum.com/member.php...fo&userid=4545
View this thread: http://www.excelforum.com/showthread...hreadid=517002