|
Subject:
|
hyperlink - top/bottom of screen
|
|
Posted By:
|
kritimehrotra
|
Post Date:
|
7/19/2006 8:21:14 PM
|
Hi,
I have hyperlinks in a sheet that simply take you to other places in the same sheet. The problem I am facing is that on some computers, clicking on a link (let's say it's destination is cell A101), shows that cell (A101) at the bottom of the visible screen, whereas on other computers, clicking on the same link shows the cell (A101) at the top of the visible screen. What I need is for it to always show at the top. The versions of Excel on these machines are the same...so I'm wondering is there a setting somewhere in Excel that this needs to be set?
Please do respond, I need this to work!
Thank you, Kriti
|
|
Reply By:
|
SMI
|
Reply Date:
|
7/20/2006 2:24:12 AM
|
Hello Copy the following code in worksheet's hyperlink event
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
' This is the single line that does the job ActiveWindow.ScrollRow = ActiveCell.Row
End Sub
Obvioulsy, whenever you click a hyperlink, it takes you to a specfied location in your worksheet, then you can use "ActiveCell.Row" property to do required scroll and that's all done.
Genius is 99% perspiration and 1% inspiration
|
|
Reply By:
|
kritimehrotra
|
Reply Date:
|
7/20/2006 10:24:23 AM
|
Thank you so so much. It worked great.
|
|
Reply By:
|
kritimehrotra
|
Reply Date:
|
12/1/2006 10:12:10 AM
|
Hi,
I'm having some trouble again! It turns out that the Worksheet_FollowHyperlink event (or in my case the Workbook_SheetFollowHyperlink event) is triggered only if the hyperlink clicked is a TEXT hyperlink, and not if it is a shape hyperlink. Is there a way to rectify this? Because I need the "ActiveWindow.ScrollRow = ActiveCell.Row" code to be executed when shape hyperlinks are clicked as well.
Thank you! Kriti
|