Auto scroll down event

A

andy62

This should be easy, but I can't quite get it. I need an event macro that
will cause the current worksheet to "scroll down" to the end of the data set
before going to the other, selected worksheet. The data set is fixed, so I
could use something like "ActiveWindow.ScrollRow =", or "Application.Goto
Reference:=" to a name/bookmark. I tried to use those functions inside
"Private Sub WorkSheet_Deactivate()" but couldn't get it to work. Anyone?

TIA.
 
E

excelent

cant get it to work with deactivate-event, but activate seems ok if u can use
it

Private Sub Worksheet_Activate()
Application.Goto Reference:=Cells(Cells(65535, 1).End(xlUp).Row, 1),
scroll:=True
End Sub


"andy62" skrev:
 
A

andy62

Thanks, but I think Activate is not an option. The way I come into the
worksheet is via about 150 hyperlinks, so the Activate event macro would
interrupt the destination and I'd alwawys arrive at the bottom of the
worksheet.
 
E

excelent

ok try put in ThisWorkbook insted

Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
Application.Goto Reference:=Cells(Cells(65535, 1).End(xlUp).Row, 1),
scroll:=True
End Sub


"andy62" skrev:
 
A

andy62

I appreciate all the help, but that routine still defeats the hyperlinks and
I end up at the bottom of the destination worksheet.

Here's the need restated - but I don't blame you for giving up!

Two sheets, "Index" and "Library". Index has a list of 150 topics, each of
which hyperlink into a different row in column A of Library. Need to have
the hyperlinks always arrive in Library at the top of the active window. A
logical approach seems to be to have Library scroll to the end (row 1112)
upon Deactivate. Doing it on the way in (using Activate) seems to override
the hyperlinks. Finally, do NOT want the Index worksheet to be affected by
the routine; want the active cell and window in Index to remain in place
after leaving and returning the worksheet.
 
E

excelent

try insert in Library-sheet-tab-code-window

Private Sub Worksheet_Activate()
Application.Goto Reference:=ActiveCell, scroll:=True
End Sub


"andy62" skrev:
 
A

andy62

Awesome, that did it! Thanks a million.

excelent said:
try insert in Library-sheet-tab-code-window

Private Sub Worksheet_Activate()
Application.Goto Reference:=ActiveCell, scroll:=True
End Sub


"andy62" skrev:
 
Top