ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I get a "link-to" cell to appear in upper left (Excel) (https://www.excelbanter.com/excel-worksheet-functions/198944-how-do-i-get-link-cell-appear-upper-left-excel.html)

Dadders

How do I get a "link-to" cell to appear in upper left (Excel)
 
In Excel, I would like to ensure that, if a link points to a cell in the
middile of the target page, then that named cell should appear at the upper
left corner of the resulting view. How do I get there from here?


Héctor Miguel

How do I get a "link-to" cell to appear in upper left (Excel)
 
hi, !

In Excel, I would like to ensure that, if a link points to a cell in the middile of the target page
then that named cell should appear at the upper left corner of the resulting view.
How do I get there from here?


copy/paste/type/... the following in ThisWorkbook code module...

Dim fromHyperlink As Boolean
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
fromHyperlink = Target.Hyperlinks.Count
If fromHyperlink Then
ActiveWindow.ScrollRow = ActiveCell.Row
ActiveWindow.ScrollColumn = ActiveCell.Column
fromHyperlink = False
End If
End Sub

hth,
hector.



Dadders

How do I get a "link-to" cell to appear in upper left (Excel)
 
Hi. Hector. Thanks for the module. Looks good but, for some reason, it's
not working. I'll study it out a little more and see what I can come up with.

Note; My test case is a hyperlink which refers to cell A141 on another
spreadsheet in the same work book. When the link is activated, Cell A141
will appear in a variety of locatins, sometimes as the very last row in the
display, sometimes about midway down, but NEVER in the Upper Left corner of
the display.

Thanks again for your help!

"Héctor Miguel" wrote:

hi, !

In Excel, I would like to ensure that, if a link points to a cell in the middile of the target page
then that named cell should appear at the upper left corner of the resulting view.
How do I get there from here?


copy/paste/type/... the following in ThisWorkbook code module...

Dim fromHyperlink As Boolean
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
fromHyperlink = Target.Hyperlinks.Count
If fromHyperlink Then
ActiveWindow.ScrollRow = ActiveCell.Row
ActiveWindow.ScrollColumn = ActiveCell.Column
fromHyperlink = False
End If
End Sub

hth,
hector.





All times are GMT +1. The time now is 05:02 PM.

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