How to Use an Excel Slicer to Navigate Between Worksheets
Question details
Configure an Excel slicer to act as a visual navigation menu that switches between different worksheet tabs based on the user's selection.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- A user wants to create an interactive dashboard where selecting an item in a slicer automatically jumps to a corresponding worksheet.
- Observed behavior
- By default, slicers only filter table or PivotTable data. The goal is to bind the slicer selection to a macro or hyperlink that actively changes the currently active worksheet.
Ensure your workbook is saved as a Macro-Enabled Workbook (.xlsm), as VBA code is required to capture the slicer selection and trigger the worksheet navigation.
Use VBA and the PivotTableUpdate Event for Navigation
By creating a foundational PivotTable and capturing the update event triggered when a slicer is clicked, you can use VBA to activate specific worksheets automatically.
Since slicers do not have their own click events in Excel VBA, you must link the slicer to a PivotTable. Whenever the slicer is clicked, it updates the PivotTable, triggering a Worksheet_PivotTableUpdate event that your VBA code can intercept.
Select a data range containing a column with the exact names of your destination worksheets. Go to Insert > PivotTable. Place this PivotTable on your main dashboard sheet and add the worksheet name field to the PivotTable.
Click anywhere inside your newly created PivotTable. Go to the PivotTable Analyze tab on the ribbon, click Insert Slicer, check the box for your worksheet names field, and click OK.
Press Alt + F11 to open the VBA Editor. In the Project Explorer pane on the left, double-click the worksheet that contains your PivotTable and Slicer. Paste a Worksheet_PivotTableUpdate macro that iterates through the SlicerCache to find the selected item, and uses Sheets(selectedName).Activate to navigate to the target sheet.

Use Slicer Selections with Dynamic Hyperlinks
If you prefer minimizing VBA usage, you can combine slicer selections with Excel's HYPERLINK function and a lightweight macro.
Easily Build Interactive Dashboards with WPS Spreadsheet
WPS Office provides robust, built-in support for PivotTables, Slicers, and VBA macros. You can execute custom VBA scripts to navigate between worksheets seamlessly while enjoying a highly intuitive interface.
- 1. Open your workbook: Launch WPS Spreadsheet and open your .xlsm file containing the dashboard data.
- 2. Insert PivotTable and Slicer: Navigate to the Insert tab, create a PivotTable, and click Slicer to generate your visual navigation menu.
- 3. Add the VBA code: Enable the Developer tab, open the VBA Editor, and paste your PivotTableUpdate macro to handle the worksheet transitions.

Frequently Asked Questions
Why is my VBA code not triggering when I click the slicer?
Slicers do not have native click events in VBA. Your macro must be placed within the specific Worksheet module where the linked PivotTable resides, and it must use the Worksheet_PivotTableUpdate event to detect the slicer click.
Can I use this method to navigate to hidden worksheets?
Yes, but your VBA macro must first unhide the worksheet by setting its Visible property to xlSheetVisible before attempting to activate it. If you try to activate a hidden sheet directly, Excel will return an error.
How do I prevent multiple worksheet selections in the slicer?
To ensure accurate navigation, users should only select one item at a time. While you cannot physically disable the multi-select button on a slicer without complex APIs, you can add an error-handling check in your VBA code (e.g., checking if SlicerItems.Selected count is greater than 1) and prompt the user to select only one destination.
Why do I get a 'Subscript out of range' error when the macro runs?
This error typically occurs when the name selected in the slicer does not perfectly match any existing worksheet tab name. Check your source data for typos, trailing spaces, or differences in capitalization compared to your actual worksheet tabs.




