How to make the last rows visible?

F

fred

Hello,
I am using Excel automation and vbasic 5 programming to add data to the
opened sheet, however after reaching the sheet's window full of data the
next rows of data are below the screen.
How to display the current row and preferrably a few empty rows after that
in real time?
Please advise,
Fred
 
J

JLGWhiz

This will scroll down five rows on the active sheet.

Sub fj()
ActiveWindow.SmallScroll Down:=5
End Sub

You should be able to manually scroll. However, if you need to use code the
above scrolls by line. Use the same syntax with LargeScroll to scroll by
page. Direction options are Up:=, Down:=, Right:= and Left:=
 
R

Rick Rothstein

You can set the row number of the top visible row for the active sheet using
this...

ActiveWindow.Panes(ActiveWindow.Panes.Count).ScrollRow = RowNumber

where RowNumber is the number of the row that you want displayed at the top
of the active worksheet. If you want to show some of the filled rows above
that row, you can subtract that number for RowNumber (but you will need to
protect against the value going negative. Something like this...

If RowNumber > 15 Then
ActiveWindow.Panes(ActiveWindow.Panes.Count).ScrollRow = RowNumber - 15
End If
 
F

fred

Thank you. That is a good start.
But, how to detect that the row is already off screen?
I do not want to do scroll anything until the page is filled.
Thanks,
Fred
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top