• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How do I create hyperlinks in Excel that open hidden worksheets?

@vishalvijayan


Hi


i think when the sheet is hidden then hyperlink is not work so please try the below code

[pre]
Code:
Sub Button1_Click()
 'Unhide the active sheet and
 'Goto to 'sheet2'
With ActiveWorkbook.Worksheets("Sheet2")
 .Visible = True
 ' Unhide ActiveSheet If Not 'Sheet2'
If .Name <> ActiveSheet.Name Then
End If
 Application.Goto _
 Reference:=.Range("A1"), _
 Scroll:=True
End With
End Sub
[/pre]

with the above code you have to create one command button and paste the above code in Sheet1 when press the button then hidden sheet2 is activate


Hope it will clear otherwise refer us again


Thanks


SP
MOD EDIT: code cleaned through http://chandoo.org/forum/threads/upgraded-forums-old-vba-codes-formula-handling.12080/
 
Last edited by a moderator:
Hi Vijayan ,


An alternative is to use the Worksheet_FollowHyperlink event procedure :

[pre]
Code:
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)

link = Target.Name

sheetname = Left(link, InStr(1, link, "!") - 1)

rangename = Right(link, Len(link) - InStr(1, link, "!"))

If Not (Worksheets(sheetname).Visible) Then Worksheets(sheetname).Visible = True

Worksheets(sheetname).Activate

ActiveSheet.Range(rangename).Select

End Sub
[/pre]
If the hyperlink is in a cell on Sheet1 , then this procedure has to be in the Sheet1 section.


Note that there is nothing special about the hyperlink , even though it refers to a cell in a hidden sheet. It is the macro which will unhide the sheet , activate it and put the cursor in the required cell.


Narayan
MOD EDIT: code cleaned through http://chandoo.org/forum/threads/upgraded-forums-old-vba-codes-formula-handling.12080/
 
Last edited by a moderator:
i made a hyperlink to hidden sheets using macro and it works with me but when i open it online the link doesn't work please help me
 
i made a hyperlink to hidden sheets using macro and it works with me but when i open it online the link doesn't work please help me
Hi ,

Please start a new thread , and explain your problem in more detail ; if possible , also attach your workbook with the hyperlinks and code in it.

Narayan
 
Back
Top