Hyperlink events

Z

ZipCurs

I am trying to do what I assume would be simple. I want to initiate some
code when a hyperlink is clicked. I have put to following code in Sheet1,
which has the hyperlink(s).

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Sheets("Sheet1").Range("B1") = "It Ran"
End Sub

The hyperlink runs, but never runs the code. I am running Excel 2007.
 
B

Barb Reinhardt

In the immediate window type this and try again
APplication.EnableEvents = True
 
Z

ZipCurs

Hello Barb,

Thank you for the quick response. I definitely have the events enabled. I
substituted the following code and it worked fine:

Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveCell.Address = "$B$12" Then
Sheets("Sheet1").Range("B1") = "It Ran"
End If
End Sub

The problem seems to be linked to the HyperLink event, which does not run.
Any clues? I eventually plan on putting the code into a workbook with plenty
of other events, so I would prefer to keep the response focused on HyperLink
activation.
 

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