How to Open a Hidden Excel Sheet from an Icon Hyperlink using VBA
Question details
The user needs to trigger a VBA macro to unhide and open a specific hidden worksheet by clicking a hyperlink attached to an icon or shape.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- The user is attempting to navigate to a hidden sheet via an icon instead of standard cell text, but the Worksheet_FollowHyperlink event fails to fire correctly.
- Observed behavior
- The existing VBA code functions correctly for regular text hyperlinks located in cells but does not respond when clicking a hyperlink attached to an icon or shape.
Ensure your workbook is saved as a Macro-Enabled Workbook (.xlsm) and that macros are permitted to run in your Trust Center settings so the VBA code can execute.
Configure the Icon Hyperlink and Update FollowHyperlink VBA
Manually assign a specific cell reference to the icon's hyperlink and update the Worksheet_FollowHyperlink event to unhide the target sheet before navigating.
Excel VBA treats hyperlinks on shapes and icons differently than text hyperlinks in cells. To ensure the macro triggers correctly, the shape must have a valid hyperlink target formatted properly.
By pointing the shape directly to a cell inside the hidden sheet and using the Worksheet_FollowHyperlink event, Excel will recognize the click, unhide the sheet, and complete the navigation.
Select the icon or shape, right-click it, and choose 'Hyperlink' or 'Link' from the context menu.
In the Insert Hyperlink dialog, select 'Place in This Document' and enter a target reference exactly like #HiddenSheet!A1 (replace 'HiddenSheet' with the actual name of your hidden worksheet).
Press Alt + F11 to open the Visual Basic for Applications (VBA) editor, and double-click the sheet containing your icon from the Project Explorer.
Insert or update the Worksheet_FollowHyperlink subroutine to check the hyperlink target, change the target sheet's Visible property to xlSheetVisible, and activate the sheet.

Use WPS Spreadsheet to Manage Macros and Hyperlinks
WPS Spreadsheet offers excellent compatibility with Excel macros (VBA) and shape hyperlinks, allowing you to easily link shapes and icons to hidden sheets while executing complex automation.
- 1. Open your workbook: Launch WPS Spreadsheet and open your Macro-Enabled Workbook (.xlsm).
- 2. Add the hyperlink: Right-click your shape or icon, select 'Hyperlink', and point it to your hidden sheet.
- 3. Enable macros: Navigate to the Developer tab and click 'Macros' to ensure your workbook's scripts are active.
- 4. Edit the VBA code: Use the built-in WPS Macro Editor to handle the Worksheet_FollowHyperlink event and unhide your sheet seamlessly.

Frequently Asked Questions
Why does my VBA code work for cell hyperlinks but not shape hyperlinks?
Hyperlinks attached to shapes or icons require an explicit sub-address (such as #SheetName!A1) to properly trigger the Worksheet_FollowHyperlink event in Excel, whereas cell hyperlinks often fire the event natively without complex targeting.
Can I link an icon to a hidden sheet without using VBA?
No, standard hyperlinks cannot unhide sheets automatically. You must use VBA to change the target sheet's visible property to 'Visible' before Excel can navigate to it.
How do I hide the worksheet again after I am done using it?
You can automate this by adding code to the Worksheet_Deactivate event of your hidden sheet. When you navigate away, the macro can automatically reset the sheet's visible property to xlSheetHidden or xlSheetVeryHidden.




