How to Use a Calculated Excel Hyperlink with a Button or Image on Mac
Question details
The user wants to navigate to a dynamically named worksheet (referenced in a cell like B1) by clicking a button or image.

- Product
- Microsoft Excel
- Device & OS
- Mac
- Scenario
- Creating a dynamic navigation menu or dashboard where a shape, button, or image directs the user to different sheets based on a calculated formula.
- Observed behavior
- Excel does not natively allow assigning dynamic or calculated HYPERLINK formulas directly to shapes or buttons; the hyperlink function on shapes only accepts static addresses.
Ensure your Excel workbook is saved as a Macro-Enabled Workbook (.xlsm) if you plan to use the VBA solution, as standard .xlsx files cannot save macro code.
Use a VBA Macro for Dynamic Button Navigation
Since native Excel shapes cannot process dynamic formulas, you can use a short VBA macro to read the target sheet name from a cell and navigate to it when the button is clicked.
This method requires writing a simple script in the Visual Basic Editor. The script will read the value in your reference cell (e.g., B1), activate the corresponding worksheet, and optionally select a specific cell.
Press 'Option + F11' on your Mac keyboard to open the Visual Basic for Applications (VBA) editor.
In the top menu, click 'Insert' and select 'Module' to create a blank workspace for your code.
Type the following code: Sub GoToDynamicSheet() Dim sheetName As String sheetName = Sheets("Sheet1").Range("B1").Value Sheets(sheetName).Activate End Sub (Replace 'Sheet1' and 'B1' with your actual sheet and cell reference).
Return to your Excel worksheet, right-click the button or image, select 'Assign Macro...', choose 'GoToDynamicSheet' from the list, and click 'OK'.

Use an In-Cell Calculated HYPERLINK (No-Code Alternative)
If you prefer not to use VBA macros, you can create a dynamic hyperlink using the native HYPERLINK function and format the cell to look exactly like a button.
Experience Seamless Spreadsheet Navigation with WPS Office
While assigning dynamic hyperlinks to shapes requires VBA workarounds in Excel, WPS Office provides a lightweight, highly compatible alternative for Mac users. With excellent support for complex formulas, VBA macros, and seamless Excel (.xlsx, .xlsm) file compatibility, managing your data has never been easier.
- 1. Download WPS Office: Visit the official WPS website and download the Mac version.
- 2. Install and Launch: Follow the on-screen instructions to install the suite and open WPS Spreadsheet.
- 3. Open Your Excel File: Drag and drop your existing .xlsx or .xlsm file into WPS to continue working seamlessly with all your formulas and macros intact.

Frequently Asked Questions
Can I link a shape to a cell reference without using macros?
You can link a shape to a static location by right-clicking it, selecting 'Hyperlink', and choosing 'Place in this Document'. However, it cannot dynamically read a formula or change its destination based on another cell's value without using VBA.
Why isn't my HYPERLINK formula working when assigned to an image?
Excel's 'Assign Hyperlink' menu for graphical objects (shapes, images, buttons) only accepts static web addresses or predefined document locations. It does not evaluate spreadsheet functions like HYPERLINK().
Are VBA macros safe to use on Mac for spreadsheet navigation?
Yes, macros you write yourself or obtain from trusted sources are completely safe. Just remember to save the file as an .xlsm (Macro-Enabled Workbook) to retain the code and ensure your macro security settings allow the code to run.




