Hiding tabs that I need to link to

JSeymore

New Member
Joined
Apr 28, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi guys,

I'm not too savvy on excel, but know the basics and maybe a little more than that. I am wanting to hyperlink the Item Numbers to the tabs with the same names. I want to hide these tabs but when I do hide them, I cannot open the link when I click on them anymore. I have seen some codes on how to fix this, but they are catered to the specific question and I have been unable to make it work for me. Can anyone see this picture, and help with the coding it would take to hide the cells and still be able to click on the hyperlinks and open the pages?

Thanks in advance!
 

Attachments

  • excel.JPG
    excel.JPG
    88.1 KB · Views: 6

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

John_w

MrExcel MVP
Joined
Oct 15, 2007
Messages
7,650
Try this code in the ThisWorkbook module:
VBA Code:
Private Sub Workbook_SheetFollowHyperlink(ByVal Sh As Object, ByVal Target As Hyperlink)

    Dim p As Long, targetSheet As String
    
    With Target
        p = InStr(1, .SubAddress, "!")
        If p > 0 Then
            targetSheet = Replace(Left(.SubAddress, p - 1), "'", "")
            Worksheets(targetSheet).Visible = True
            Worksheets(targetSheet).Select
            Worksheets(targetSheet).Range(Mid(.SubAddress, p + 1)).Select
        End If
    End With
    
End Sub
 

Forum statistics

Threads
1,182,107
Messages
5,933,697
Members
436,905
Latest member
Ibraeh

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
Top