View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Steve Yandl[_3_] Steve Yandl[_3_] is offline
external usenet poster
 
Posts: 117
Default return top and bottom row in window

The subroutine below will return the row numbers of the top and bottom
visible rows in the active Window.

'-----------------------------------------------------

Sub TopAndBottomRow()
Dim lngTopRow As Long
Dim lngBottomRow As Long

With ActiveWindow
lngTopRow = .VisibleRange.Cells(1, 1).Row
lngBottomRow = .VisibleRange.Cells(.VisibleRange.Rows.Count, 1).Row
End With

MsgBox "You can see rows " & lngTopRow & " to " & lngBottomRow

End Sub


'-----------------------------------------------------

Steve Yandl



"sunilpatel" wrote in message
...

How can you return the top and bottom row in a window. Also is there a way
to lock and unlock scrolling with mouse wheel

Thanks