Getting HyperLinked Cell to Appear at the Top of the Screen

  • Thread starter Thread starter John Tjia
  • Start date Start date
J

John Tjia

I am inserting hyperlinks in my file. No problem with setting up a
range linked to the hyperlink, so that the cursor jumps to the range.
(I am doing the hyperlinks from a set of instruction headings at the
top of a sheet, to the actual paragraphs further down the sheet that
explain certain things in the model.)

What I find is that the cursor lands on the correct spot, but this
spot is at the bottom of the screen, so the user has to do a page down
to see the paragraphs that follow. Is there a way to make the place
where the cursor lands shift automatically so that it is at the top
left of the screen?
 
What version of Excel. If using Excel 2000 or later, you might use the
followhyperlink event.
 
I'm using Excel 2002 SP-1.

The followhyperlink event is a VBA code? So far I am using the
Insert, Hyperlink sequence on the menu bar. Where do I look to start
learning the followhyperlink event?
 
right click on the sheet tab (with the hyperlink) and select View code.

In the left dropdown, select worksheet. In the right dropdown select
followhyperlink

This will put the declaration for th event in the module.

It has an argument target which is a hyperlink object. It will hold a
reference to the hyperlink that triggered the event.

Private Sub FollowHyperlink( Target as Hyperlink)
msgbox Target.Range.Address
End Sub

will display the cell address of the hyperlink as an example.

To position the target

Private Sub FollowHyperlink( Target as Hyperlink)
ActiveWindow.ScrollRow = ActiveCell.Row
ActiveWindow.ScrollColumn = ActiveCell.column
End Sub

Worked for me.
 
Back
Top