make Hyperlink jump on the top row

R

rk0909

All,

I have quite a few hyperlinks in a workbook. Some of them are in cells and
some in objects. When I click on the hyperlinked cell or object i want that
cell to become the top row.

I was able to solve the problem for hyperlinks in the cell by using the
following code

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

Problem is that this does not work for hyperlinks in the objects. is there
a way to make the hyperlinked cell become the top row when hyperlink is
residing in an object such as a square or a rectangle.

Thanks much in advance.

RK
 
H

Homey

since follow hyperlink event not fire when shape clicked and since if you
have hyprlink in a shape the macro assigned to that shape not run i think
you shoud get rid of link and instead just assign macro to shape. this a
expl

Sub ObjFollowHyperlink()
Select Case Application.Caller
Case "Rectangle 1"
Application.Goto Range("J1"), True
Case "Rectangle 2"
Application.Goto Range("P15"), True
End Select
End Sub

| All,
|
| I have quite a few hyperlinks in a workbook. Some of them are in cells
and
| some in objects. When I click on the hyperlinked cell or object i want
that
| cell to become the top row.
|
| I was able to solve the problem for hyperlinks in the cell by using the
| following code
|
| Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
| ActiveWindow.ScrollRow = ActiveCell.Row
| End Sub
|
| Problem is that this does not work for hyperlinks in the objects. is
there
| a way to make the hyperlinked cell become the top row when hyperlink is
| residing in an object such as a square or a rectangle.
|
| Thanks much in advance.
|
| RK
 

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