FryGirl
Well-known Member
- Joined
- Nov 11, 2008
- Messages
- 1,364
- Office Version
- 365
- 2016
- Platform
- Windows
On my spreadsheet, I have cell C23542 highlighted as the activecell. I'm going to be reading down to row C23635 (or could be another range within column C). As I'm reading the text, I would like the screen to scroll until it hits the last cell, but with this code, the activecell never changes during the scroll, so I don't know how to exit as I reach the last cell. How can I achieve this scrolling?
VBA Code:
Sub CreateScrollDown()
Dim lastrow As Long: lastrow = Range("A" & Rows.Count).End(xlUp).Row
Dim StopPoint As Long: StopPoint = Range("MyEnd")
While Intersect(Rows(lastrow), ActiveWindow.VisibleRange) Is Nothing
Application.Wait (Now + TimeValue("0:00:01"))
ActiveWindow.SmallScroll down:=Round(ActiveWindow.VisibleRange.Rows.Count / 5, 0)
Wend
Application.Wait (Now + TimeValue("0:00:03"))
ActiveWindow.ScrollRow = 1
End Sub