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

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
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,215,095
Messages
6,123,072
Members
449,093
Latest member
ripvw

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