Macro attached to Autoshape Hyperlink not invoking

K

kenman

Hi
I have a Hyperlink associated with an Autoshape. The purpose of the
hyperlink is to to scroll to another part of the worksheet.
However, I want to target cells of the hyperlink to appear at the to
of
the page instead of the bottom.

I found a good suggestion on the forum on how to do this - se
below.

If I create a hyperlink on a cell, this works great and I can see tha
the
macro gets executed.
However for the hyperlink associated with the autoshape, the macro doe
not
get invoked.

Any Ideas why ? I am using Excel 2003.


1. start with a fresh, brand new, worksheet.
2. select A1 in Sheet1 and pull-down:
a. Insert > Hyperlink > Place in this document > B9
3. click the link to insure we get to B9
4. right-click the tab (sheet name) at the bottom and select View code
5. Paste this in:

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Dim s As String
MsgBox ("re-scrolling")
s = ActiveCell.Address(ReferenceStyle:=xlR1C1)
Application.Goto Reference:=s, Scroll:=True
End Sub

Any help appreciate
 

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