I have this code that scrolls down the page.
It starts at B8 but doesn't stop.
How do I make it stop at row 158 then start over from the top.
It will loop until {ESC} is pressed.
Thanks, PuJo
It starts at B8 but doesn't stop.
How do I make it stop at row 158 then start over from the top.
It will loop until {ESC} is pressed.
Thanks, PuJo
Code:
Sub SlowScroll()
Application.EnableCancelKey = xlErrorHandler
On Error GoTo ErrHandler
Dim r As Long
Range("B8").Select
Do
DoEvents
Sleep 2000
ActiveWindow.SmallScroll Down:=5
r = r + 1
If r = 50 Then Range("B8").Select: r = 0
Loop
Application.EnableCancelKey = xlInterrupt
Exit Sub
ErrHandler:
Application.EnableCancelKey = xlInterrupt
ActiveWindow.ScrollRow = 1
End Sub