logo
search
VBA & Macro Problems

How to Hide Excel Sheet Tabs Without Breaking Hyperlinks

WPS Content ManagerWPS Content Manager Sep 27, 2026 869 views

Question details

The user needs to hide worksheet tabs to create a cleaner interface while ensuring that internal hyperlinks pointing to those hidden sheets continue to function automatically.

Hide Excel Sheet Tabs Without Breaking Hyperlinks
Product
Excel
Device & OS
not provided
Scenario
Designing a clean, navigation-driven workbook interface by hiding default sheet tabs but maintaining functional internal hyperlink navigation.
Observed behavior
By default, clicking a hyperlink that targets a hidden sheet results in an invalid reference error. The intended state is for the sheet to automatically unhide and activate when its link is clicked.
Before you start

Ensure you are comfortable using the VBA Editor, and remember to save your file as a Macro-Enabled Workbook (.xlsm) for the script to execute successfully.

Solution 1Recommended

Use the Workbook_SheetFollowHyperlink VBA Event

Add a VBA macro to the ThisWorkbook module that detects a clicked hyperlink, unhides the destination sheet, and activates the target cell.

Native Excel hyperlinks cannot navigate to hidden worksheets. By using the Workbook_SheetFollowHyperlink event, you can intercept the hyperlink click before the error occurs. The macro reads the hyperlink's destination, changes the target worksheet's visibility property, and successfully navigates the user to the intended cell.

1
Open the VBA Editor

Press Alt + F11 on your keyboard to launch the Visual Basic for Applications (VBA) editor.

2
Access the ThisWorkbook Module

In the Project Explorer pane on the left side of the window, locate your current workbook and double-click 'ThisWorkbook' to open its code window.

3
Insert the Hyperlink Event Code

Select 'Workbook' from the top-left dropdown above the code window, and 'SheetFollowHyperlink' from the top-right dropdown. Insert the script required to extract the hyperlink target, unhide the destination worksheet, and activate it.

4
Save as a Macro-Enabled File

Close the VBA editor and go to File > Save As. Choose 'Excel Macro-Enabled Workbook (*.xlsm)' from the format dropdown so the script runs automatically on future clicks.

Use the Workbook_SheetFollowHyperlink VBA Event
Automating Re-Hiding: You can optionally add a Worksheet_Deactivate event to the destination sheet's code module to automatically hide the tab again when the user navigates away to a different sheet.
Advanced VBA Support in WPS

Execute VBA Macros Seamlessly with WPS Office

WPS Spreadsheet offers comprehensive support for VBA and macros. You can easily insert, edit, and run Worksheet and Workbook events to manage hidden sheets and complex hyperlink navigation, exactly as you would in Microsoft Office.

  1. 1. Open your Workbook in WPS Spreadsheet: Launch WPS Spreadsheet and open your existing .xlsx or .xlsm file.
  2. 2. Navigate to the Developer Tab: Click on the 'Developer' tab in the top ribbon menu to access your macro and VBA tools.
  3. 3. Launch the VBA Editor: Click the 'VB Editor' button to open the coding environment and double-click 'ThisWorkbook' in the Project window.
  4. 4. Apply and Run the Macro: Paste your SheetFollowHyperlink VBA script, save the workbook as a macro-enabled format, and seamlessly test your unhiding hyperlinks.
Complete compatibility with Microsoft Excel (.xlsm) macro-enabled formatsAdvanced built-in VBA Editor for handling complex hyperlink eventsLightweight architecture for faster macro execution and navigationFree and highly intuitive tabbed interface for workbook management
microsoft office alternative - wps office

Frequently Asked Questions

Why do standard hyperlinks fail when linking to a hidden Excel sheet?

Excel's native hyperlink functionality requires the target destination to be visible on the screen. If the worksheet tab is hidden, the application cannot bring the destination into view, which triggers an invalid reference error.

What is the difference between xlSheetHidden and xlSheetVeryHidden in VBA?

When a sheet is set to xlSheetHidden, users can easily unhide it manually by right-clicking any visible sheet tab and selecting 'Unhide'. If it is set to xlSheetVeryHidden, the sheet will not appear in the standard unhide menu and can only be made visible again using a VBA macro.

Do I need to enable macros for this hyperlink solution to work?

Yes. Because the automatic unhiding relies on a VBA background event (Workbook_SheetFollowHyperlink), you must enable macros in your Trust Center or Macro Security settings, and the file itself must be saved in a macro-enabled format like .xlsm.