Name

form.ScrollTop [= setting]

Synopsis

Sets or returns the position of the vertical scrollbar in points. The following code scrolls down one page at a time:

    Private Sub cmdPageDown_Click(  )
        ' Scoll form
        Me.ScrollTop = Me.ScrollTop + Me.InsideHeight
        ' Reposition this control to keep it visible.
        cmdPageDown.Top = cmdPageDown.Top + Me.InsideHeight
    End Sub

Tip

It’s usually easier to use the Scroll method than ScrollLeft and ScrollTop. See that topic for an example.

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.