Conditional hyperlink onto a shape

mrewdorrison

New Member
Joined
Jun 9, 2015
Messages
1
Hello all,

I have a project I've been working on and up till this point I've been using shapes to link to other sheets within the workbook. However, I would like to add a new "current stage" button that will send me to a specific sheet depending on the value in cell A5 in Sheet1.

I'm pretty new to excel (been teaching myself for about a year), so I don't even know if you can apply a conditional hyperlink onto a shape. If it is possible I was hoping you all could help me out.

Thanks in advance!
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hello and welcome to the Board

- create the hyperlink manually (this can be automated if you want)
- paste the code where indicated
- type the sheet name at A5 and the link will be updated.

Code:
' at Sheet1 module
Private Sub Worksheet_Change(ByVal Target As Range)
Dim s As Shape
Set s = Me.Shapes("Image1")
If Target = [a5] And Len(Target) > 0 Then s.Hyperlink.SubAddress = Range("a5") & "!a1"
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,339
Messages
6,124,365
Members
449,155
Latest member
ravioli44

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