View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Determine tje last visible row on the screen.

I would point out that the major difference between my code and Jacob's
(other than his uses looping and mine does not) appears to be this... my
code returns the row number for the last *fully* visible row (even if there
is part of another row partially visible below it) whereas Jacob's returns
the row number for whatever row is on the bottom of the (visible part of
the) worksheet even if that row is not fully visible.

--
Rick (MVP - Excel)


"Rick Rothstein" wrote in message
...
As long as you are not near the very bottom of the worksheet (that is, Row
65536 for XL2003, Row 1048576 for XL2007), I think this will work...

With ActiveWindow
.LargeScroll 1
LastVisibleRow = ActiveWindow.ScrollRow - 1
ActiveWindow.LargeScroll , 1
End With

where the bottom displayed row will be place in the LastVisibleRow
variable.

--
Rick (MVP - Excel)


"SpeeD" wrote in message
...
Hi.

I need to determine the last visible row on the screen.
Im not talking about visible true/false, but the last row a user can see
in
is monitor.
Screen Resolution can change and i really need to know the row.

Can this be done??

Thanks