ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   hyperlinking to hidden work sheets (https://www.excelbanter.com/excel-discussion-misc-queries/134135-hyperlinking-hidden-work-sheets.html)

Josie

hyperlinking to hidden work sheets
 
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


Mike

hyperlinking to hidden work sheets
 
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" wrote:

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


Mike

hyperlinking to hidden work sheets
 
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


"Josie" wrote:

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


Vergel Adriano

hyperlinking to hidden work sheets
 
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



"Josie" wrote:

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


Josie

hyperlinking to hidden work sheets
 
Where do I find this "Double-click on the ThisWorkbook object in the project
explorer. "

"Vergel Adriano" wrote:

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



"Josie" wrote:

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



All times are GMT +1. The time now is 02:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com