Macro associated with Worksheet being invoked from two different Hyperlinks

kenman1

New Member
Joined
Mar 2, 2016
Messages
3
Hello, any guidance with the following would be appreciated.
I have a Worksheet which has two Hyperlinks per each row. The first Hyperlink in Column A has a HTTP link to a Web Page, where it.

https://w3.abc.com/systema/legacy/protected/AB/mainsheet/e/ID000980/mainaction.wss

The 2nd Hyperlink in Column B invokes Macro FindOutMore and passes contents of Column C for the row in which the hyperlink is selected.

ActiveSheet.Hyperlinks.Add Anchor:=ActiveSheet.Cells(R, 2), _
Address:="", _
SubAddress:=ActiveSheet.Name & "!A1", _
TextToDisplay:="Quick View", ScreenTip:="Summary of the data"

To invoke the macro, I have the following code in "View Code" of the worksheet

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Call FindOutMore(Target.Range.Offset(0, 1).Value)
End Sub

The problem is that when I click either hyperlink, they both invoke macro FindOutMore. I only want this to happen for the 2nd Hyperlink in Column B and not the first Hyperlink in Column A which launches a Web Page. Any suggestions on how to do this ?
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
search the range of a hyperlink. then retrieve its index. then search for a hyperlink after that index
 
Upvote 0

Forum statistics

Threads
1,223,270
Messages
6,171,103
Members
452,379
Latest member
IainTru

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top