Hyperlinks

E

engmgriff

Hi

I have set a number of hyperlinks up in excel to jump to differen
worksheet in the same workbook. My problem is when i hide th
worksheets my hyperlinks do not work when I want to go to the hidde
worksheets.

Can I hide my worksheets and have a master worksheet which allows me t
jump into the hidden worksheets through hyperlinks?

Regards

Mat
 
D

Dave Peterson

How did you create the hyperlinks (insert|Hyperlink or the worksheet function
=hyperlink())?

If you used Insert|Hyperlink, then maybe you could use something like this:

Option Explicit
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)

Dim testRng As Range

If Target.Address <> "" Then
Exit Sub
End If

Set testRng = Nothing
On Error Resume Next
Set testRng = Application.Range(Target.SubAddress)
On Error GoTo 0

If testRng Is Nothing Then
'do nothing
Else
If testRng.Parent.Visible = xlSheetVisible Then
'do nothing special
Else
testRng.Parent.Visible = xlSheetVisible
Application.Goto testRng
End If
End If

End Sub

Right click on the worksheet tab that has the links and select view code. Then
paste this in the code window.

If the link points to a different workbook, then it quits.

If the link points at a valid range address, then it checks to see if that sheet
is visible. If it is, then it quits (and the hyperlink will work).

But if it isn't, then it unhides the worksheet and goes to that address.
 

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

Top