logo
search
VBA & Macro Problems

How to Open a Hidden Excel Sheet from an Icon Hyperlink using VBA

Khadija KhanKhadija Khan Oct 15, 2026 871 views

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.

How to Open a Hidden Excel Sheet from an Icon Hyperlink Using VBA
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.
Before you start

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.

Solution 1Recommended

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.

1
Assign a hyperlink to the icon

Select the icon or shape, right-click it, and choose 'Hyperlink' or 'Link' from the context menu.

2
Set the document target

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).

3
Open the VBA Editor

Press Alt + F11 to open the Visual Basic for Applications (VBA) editor, and double-click the sheet containing your icon from the Project Explorer.

4
Update the macro code

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.

Configure the Icon Hyperlink and Update FollowHyperlink VBA
Match sheet names exactly: Ensure the sheet name defined in your shape's hyperlink matches exactly with the sheet name referenced in your VBA script, including spaces.
Advanced Macro Support

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. 1. Open your workbook: Launch WPS Spreadsheet and open your Macro-Enabled Workbook (.xlsm).
  2. 2. Add the hyperlink: Right-click your shape or icon, select 'Hyperlink', and point it to your hidden sheet.
  3. 3. Enable macros: Navigate to the Developer tab and click 'Macros' to ensure your workbook's scripts are active.
  4. 4. Edit the VBA code: Use the built-in WPS Macro Editor to handle the Worksheet_FollowHyperlink event and unhide your sheet seamlessly.
Fully compatible with Microsoft Excel formats (.xlsm, .xlsx) and VBA code.Built-in robust Developer tab for editing and managing FollowHyperlink macros.Lightweight, fast to load, and completely free to use for daily tasks.
microsoft office alternative - wps office

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.