Prev: Selecting a specific sheet by codename in an opened workbook (XL03
Next: I have many excel files, would like to aggregate into one
From: ZipCurs on 9 Feb 2010 15:57 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 9 Feb 2010 16:02 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 9 Feb 2010 16:23
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. |