ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   scroll to activecell? (https://www.excelbanter.com/excel-programming/387311-scroll-activecell.html)

Mark

scroll to activecell?
 
Hello.

Someome just called with this question... he has a list of various errors...
and in that grid, he has a column of hyperlinks to a different sheet. On
that sheet, are screen shots of the various errors that are listed in the
table on the first sheet.

that part all works fine, but depending upon where the activecell is in the
hyperlink destination sheet , sometimes the activecell is at the bottom of
the window.

would someone tell me how to get the activewindow to scroll so that the
activecell is in the upper left?

the hyperlink assignment doesn't seem to let you link to vb code, but I was
thinking it would work by doing it on the sheet's activate event code...

thanks.
mark

JMay

scroll to activecell?
 
Paste this code into your sheet code window:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With ActiveWindow
.ScrollRow = ActiveCell.Row
.ScrollColumn = ActiveCell.Column
End With
End Sub

"mark" wrote:

Hello.

Someome just called with this question... he has a list of various errors...
and in that grid, he has a column of hyperlinks to a different sheet. On
that sheet, are screen shots of the various errors that are listed in the
table on the first sheet.

that part all works fine, but depending upon where the activecell is in the
hyperlink destination sheet , sometimes the activecell is at the bottom of
the window.

would someone tell me how to get the activewindow to scroll so that the
activecell is in the upper left?

the hyperlink assignment doesn't seem to let you link to vb code, but I was
thinking it would work by doing it on the sheet's activate event code...

thanks.
mark


Mark

scroll to activecell?
 
thank you very much. I do a lot of coding, but it's usually not stuff where
anyone cares just where the window is at any given time.

thanks!

"JMay" wrote:

Paste this code into your sheet code window:



All times are GMT +1. The time now is 12:20 AM.

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