Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hyperlink events
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hyperlink events
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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hyperlink events
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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can't make hyperlink function work for hyperlink to website | Excel Worksheet Functions | |||
do events? background events | Excel Programming | |||
Intra-workbook hyperlink: macro/function to return to hyperlink ce | Excel Discussion (Misc queries) | |||
reading html when hyperlink address not hyperlink text diplayed | Excel Programming | |||
Hyperlink events | Excel Programming |