Hyperlink to a cell based on the data in the cell, not the cell reference itself

billyshears

Board Regular
Joined
Aug 29, 2013
Messages
61
WorkSheet 1

Cell B1 = Happy



WorkSheet 2
A1 = Happy B1= Green C1 = Red

Can I have a hyperlink in cell A1 on Worksheet 1 that hyperlinks to Cell A1 in worksheet 2 based on the fact I wrote "Happy" in Cell B1 on Worksheet 1

Thank you
 

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.
If you try this, adding code using "View Code" on Sheet1 as shown below:

1580940290447.png

...then add this code:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("B1")) Is Nothing Then
        If Target.Value = "Happy" Then
            Target.Hyperlinks.Add Anchor:=Cells(1, 1), Address:="", SubAddress:="Sheet2!A1", TextToDisplay:="Link"
        End If
    End If
End Sub
When you change Sheet1, cell B2 to Happy, it will enter "Link" into Sheet1 cell A1 and that link goes to Sheet2 cell A1...
1123114.gif
 
Upvote 0

Forum statistics

Threads
1,214,919
Messages
6,122,259
Members
449,075
Latest member
staticfluids

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