ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   displaying specific rows on screen (https://www.excelbanter.com/excel-discussion-misc-queries/244692-displaying-specific-rows-screen.html)

johnsail

displaying specific rows on screen
 
Hi
I would like to control which lines are displayed on screen.
For example:- when user gets down to line 35 I would like to display form
line 20 onwards. When user gets to line 55 display from line 45 onwards.

I can get the screen to move by using:-

If Target.Row = 35 Then
Worksheets("Expense Sheet").Activate
ActiveWindow.ScrollRow = 20
End If

However when the user moves to line 36 the screen reverts back to displaying
from row 1 onwards.

If I test for Target.Row 34 the screen blinks /flashed every time this
partt of the macro runs.

How do I get the screen to display from row 20 and stay like that until
another ScrollRow tells it to display from row 45 onwards . . . . and so on?

Jim Thomlinson

displaying specific rows on screen
 
Not 100% sure exactly how you want it to work but this might be it...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Select Case Target.Row
Case Is 55
ActiveWindow.ScrollRow = 45
Case Is 35
ActiveWindow.ScrollRow = 20
End Select
End Sub

--
HTH...

Jim Thomlinson


"johnsail" wrote:

Hi
I would like to control which lines are displayed on screen.
For example:- when user gets down to line 35 I would like to display form
line 20 onwards. When user gets to line 55 display from line 45 onwards.

I can get the screen to move by using:-

If Target.Row = 35 Then
Worksheets("Expense Sheet").Activate
ActiveWindow.ScrollRow = 20
End If

However when the user moves to line 36 the screen reverts back to displaying
from row 1 onwards.

If I test for Target.Row 34 the screen blinks /flashed every time this
partt of the macro runs.

How do I get the screen to display from row 20 and stay like that until
another ScrollRow tells it to display from row 45 onwards . . . . and so on?



All times are GMT +1. The time now is 01:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com