Help with Excel 2011 for a mac

joudeh2

New Member
Joined
Dec 22, 2011
Messages
3
I have hidden sheets that I want to 'unhide' once a hyperlink is clicked but can not figure out the code needed on each sheet.

I've tried this code I found online but it's not working for me.

Please help!

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
shtname = Left(Target.SubAddress, WorksheetFunction.Find(“!”, Target.SubAddress) – 1)
Sheets(shtname).Visible = True
Me.Visible = xlSheetHidden
End Sub
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Welcome to the board.

Try this in the ThisWorkbook module:

Code:
Private Sub Workbook_SheetFollowHyperlink(ByVal Sh As Object, ByVal Target As Hyperlink)
    Worksheets(Left(Target.SubAddress, InStrRev(Target.SubAddress, "!") - 1)).Visible = xlSheetVisible
    Sh.Visible = xlSheetHidden
End Sub
 
Upvote 0
Thanks for your answer but this is still not working for me.

I am placing the code in the "General and Declarations" portion of the VBA project for the sheet with the pictures that are hyperlinked.

Is that the correct location?

Thank you very much for your help!
 
Upvote 0
No, it goes in the ThisWorkbook module so it works for all sheet.
 
Upvote 0
It does -- the FollowHyperlink event doesn't trigger for pictures or hyperlinks created with the HYPERLINK function. I don't have another suggestion, unless you want to hide all other sheets when a new sheet activates.
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,316
Members
452,634
Latest member
cpostell

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