hyperlinking to hidden work sheets

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Please can you help?
I have a spreadsheet with 13 work sheets I want to hide 12 of them so only
one is visable but then use hyperlinks to access the hidden pages. I can set
up the hyperlinks, but then as soon as I hide the page the link does not work
any more.
Thanks
 
Use a buttons on your visible worksheet instead that call a macro like this.
Simply allter the code for each button to reflect the sheet name.

Sub Button1_Click()
Worksheets("sheet4").Visible = True
Worksheets("sheet4").Select
End Sub


Then use this in the code for each sheet to make it invisible again

Private Sub Worksheet_Deactivate()
Worksheets("Sheet4").Visible = False
End Sub

This latter code is entered by right-clicking the sheet tab and pasting it
in there.

Mike
 
Josie,

Sorry the line to make the sheet invisible again should be:-
Worksheets("Sheet4").Visible = xlVeryHidden

Making it very hidden stops someone using format - sheets - unhide.

Mike
 
Assuming that Sheet1 is where you have your hyperlinks and just to give an
example, let's say A1 links to Sheet2!A1, A2 links to Sheet3!A1.

1. Right-Click on the Sheet1 tab, click on View Code and paste this code:

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Application.EnableEvents = False
Select Case Target.Range.Address
Case "$A$1"
Sheet2.Visible = xlSheetVisible
Target.Follow
Case "$A$2"
Sheet3.Visible = xlSheetVisible
Target.Follow
End Select
Application.EnableEvents = True
End Sub

2. Double-click on the ThisWorkbook object in the project explorer. Paste
this code:

Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
If Sh.Name <> "Sheet1" Then
Sh.Visible = xlSheetVeryHidden
End If
End Sub
 
Where do I find this "Double-click on the ThisWorkbook object in the project
explorer. "
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top