Links and cells

nitind

Board Regular
Joined
Oct 30, 2008
Messages
77
I have 4 (a,b,c,d) sheets .Out of these 4 sheets ,3 sheets (a,b,c) have a number of links to the 4th worksheet (i.e. d).Now I want that when I go from "sheet a" to "sheet d" , i should be able to get the cell no of "sheet a" in which the user clicked to activate "sheet d" .
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Include this code in the ThisWorkbook VBA module of your workbook:

Code:
Private Sub Workbook_SheetFollowHyperlink(ByVal Sh As Object, ByVal Target As Hyperlink)
    Set hyperlinkCell = Target.Range
    MsgBox ("Hyperlink clicked on worksheet " & Sh.Name & " in cell " & hyperlinkCell.Address)
End Sub

and declare the global variable hyperlinkCell in a standard VBA module for use in other routines:

Code:
Public hyperlinkCell As Range

That should do the trick,
Rolf
 
Upvote 0

Forum statistics

Threads
1,213,521
Messages
6,114,109
Members
448,548
Latest member
harryls

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