Share via

Excel Hyper link and Hide sheet

Anonymous
2014-02-25T07:57:05+00:00

I want to hyperlink another sheet in the same file but want to hide the sheet also.

I created a Index sheet as the first sheet of excel file. Index sheet has a hyperlink to other sheets. If i hide the other sheets and click on the Index sheet hyperlink, it does not work, it work only when sheets are visible.

I do not want people to get confused with many sheets. I want one Index sheet, this sheet will have hyperlink to other sheet on the same excel file. I will hide the other sheets. Reader clicks the hyper link in the index sheet and gets the other respective sheet (but cannot see the sheet)

How we can do this?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2014-03-04T17:48:20+00:00

Re:  debug warning

Most likely the underscore in one or both of these lines is missing:

Line 5...

"strAddress = _"

-OR-

Line 7...

"ThisWorkbook.Worksheets(Left$(strAddress, _"

Note that a space comes before the underscore.

The " _" is a line continuation character that joins a code line with the line below.

'---

Jim Cone

Was this answer helpful?

0 comments No comments

Answer accepted by question author

Anonymous
2014-02-25T13:37:21+00:00

Re:  hyperlink to hidden sheet

Place the following code in the Index sheet module (not in a regular module).

'---

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)

 'Jim Cone - Portland, Oregon USA

  On Error GoTo FixThings

  Dim strAddress As String

  strAddress = _

  Application.WorksheetFunction.Substitute(Target.SubAddress, "'", vbNullString)

  ThisWorkbook.Worksheets(Left$(strAddress, _

      InStr(1, strAddress, "!") - 1)).Visible = xlSheetVisible

  Application.EnableEvents = False

  Target.Follow

FixThings:

  Application.EnableEvents = True

End Sub

'---

Jim Cone

Portland, Oregon USA

free & commercial excel programs

https://goo.gl/IUQUN2 (Dropbox)

Was this answer helpful?

0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2014-03-04T16:18:53+00:00

    Jim Cone,

    Thanking you for the reply. I copied and pasted the code in VBA editor

    May be i could have pasted the code wrong. It is not working. It gives debug warning.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2014-03-03T22:52:36+00:00

    Re:  hyperlink to hidden sheet and _

    "Can i get the solution if i follow the link below your signature?"

    The answer to your question about 'following the link below by signature' is:  No, you can't find a solution there.

    The solution I posted is VBA programming code that should be pasted into the code module behind your index sheet.  That code module is acessed by right-clicking your Index sheet tab and choosing "View Code".

    The code is pasted into the larger white area on the right side.  It will work automatically, everytime you click a hyperlink to a hidden sheet.

    If you still have questions, please be very specific.

    '---

    Jim Cone

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2014-03-03T07:01:05+00:00

    Dear Jim Cone,

    Thanking you for the reply.

    However i could not fully understand the method and fix. Can i get the solution if i follow the link below your signature?

    JBR1968

    Was this answer helpful?

    0 comments No comments