From: ZipCurs on
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.
From: Barb Reinhardt on
In the immediate window type this and try again
APplication.EnableEvents = True
--
HTH,

Barb Reinhardt



"ZipCurs" wrote:

> 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.
From: ZipCurs on
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.

"Barb Reinhardt" wrote:

> In the immediate window type this and try again
> APplication.EnableEvents = True
> --
> HTH,
>
> Barb Reinhardt
>
>
>
> "ZipCurs" wrote:
>
> > 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.