hyperlink unpredictable

M

merlin

I have some buttons with hyperlinks at the top of my sheet. The idea is to
allow the user to jump down to a position way down the sheet without having
to scroll there. The problem is that excel jumps to the cell, but it doesn't
seem to care whether it's at the top or bottom. So, depending on where you
are in the sheet it might only move the row with the link to the bottom of
the screen rather than the top.

Is there any way to tell it to always place the cell you've hyperlinked to
in the top left of the screen?
 
G

Gord Dibben

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

This is sheet event code. Right-click on the sheet tab and "View Code".

Copy/paste the code into that module.

A click on a hyperlink will bring the destination cell to top left of sheet.


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top