Hyperlink to Hidden Sheets

D3allamerican07

Board Regular
Joined
Jul 22, 2015
Messages
101
I have a dashboard style sheet with cells full of error counts. Each cell takes you to a different sheet. To clean it up, I hid all of the sheets except for the Dashboard.

I would love to have it when you click the hyperlink, it unhides the hidden sheet and activates it. Also the sheet names all have a character on the end (e.g. Blue^)

The was the previous code I found but can't get it to work:
Code:
Option Explicit
Option Base 0

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)

    Dim Sp() As String
    
    Sp = Split(Target.SubAddress, "!")
    If UBound(Sp) Then ' "!" was found
        With Worksheets(Sp(0))
            .Activate
            .Visible = True
            .Range(Sp(UBound(Sp))).Select
        End With
    End If
End Sub
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
I have a dashboard style sheet with cells full of error counts. Each cell takes you to a different sheet. To clean it up, I hid all of the sheets except for the Dashboard.

I would love to have it when you click the hyperlink, it unhides the hidden sheet and activates it. Also the sheet names all have a character on the end (e.g. Blue^)

The was the previous code I found but can't get it to work:
Code:
Option Explicit
Option Base 0

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)

    Dim Sp() As String
    
    Sp = Split(Target.SubAddress, "!")
    If UBound(Sp) Then ' "!" was found
        With Worksheets(Sp(0))
            .Activate
            .Visible = True
            .Range(Sp(UBound(Sp))).Select
        End With
    End If
End Sub

The code seems fine, it's just the order of your actions. The worksheet can't be activated until it's visible. Try this:

Code:
Option Explicit
Option Base 0

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)

    Dim Sp() As String
    
    Sp = Split(Target.SubAddress, "!")
    If UBound(Sp) Then ' "!" was found
        With Worksheets(Sp(0))
	    .Visible = True
            .Activate
            .Range(Sp(UBound(Sp))).Select
        End With
    End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,575
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top