eAIR Newsletter Reformat

  • Tech Tips
  • 12.20.18

Creating a Clear Slicer Button in Excel

  • by Josh Rosales, Research Analyst, El Camino College

Scenario: You are developing an Excel dashboard based off a Pivot table or tables and you have multiple slicers to allow different combinations of data disaggregation, as in the image below. Everyone oohs and ahs until they realize what a hassle it is to uncheck each slicer in order to review the next combination of interest.

 

Four Year Success and Retention Trends in Excel with multiple slicers

This is where the slicer refresh button comes in. You can create a button that will unselect all slicers, returning your interactive graphs/charts/tables to their default form.

First, you need to have the Developer tab enabled on the ribbon. If you already see it on the ribbon, you can skip this part, but the Developer is not automatically enabled. Right-click the “Home” tab (really, any tab will do) and select “Customize the Ribbon…” from the drop-down menu. This will open a dialogue box. Ensure you are looking under the Main Tabs section under “Customize the Ribbon” on the right and select the checkbox for “Developer” below it. Select OK.

Customize the Ribbon for Developer

The Developer should now be available on the main ribbon. In the Developer tab, click “Insert” under the “Controls” Section.

Insert using Developer tab

The first option under the Form Controls menu should be “Button (Form Control)”. Select that option. Draw the box on your worksheet that will become your button. Once the button is created, you will get the Assign Macro dialogue box. The first time you do this on your machine, you have to insert the VBA script. I have already created mine, so the ClearMySlicers macro is already available, thus, I can automatically select this option for any new workbooks I create in the future.

Assign Macro Name Example

 

The first time you are creating this, select New and paste the following script in place of the existing text that starts with:

Sub Button#_Click()

End Sub

Name Macro Example

Close the VBA screen. Your macro is automatically saved. Right-click the button you created and then “Assign Macro”. Select the ClearMySlicers option and your filter is ready to go. 

As a last step, you should right-click your button one more time and choose "Edit Text" to name your Button. You should also add a description of how to use the slicers and “CLEAR FILTERS” button for readers, as shown in the example below.

Clear filters button example

VBA code courtesy of howtoexcelatexcel.com.


Back to eAIR Newsletter Reformat

About eAIR

eAIR is the newsletter of the Association for Institutional Research (AIR). From its start in October 1987 to today, eAIR remains one of the most important tools for providing news to the higher education community.

View Articles By Column

Hot Topics

Subscribe

Subscribe to eAIR

Create a free account or update your communication preferences to receive the eAIR newsletter.

Association at a Glance

Featured Opportunities

Did you know?

AIR welcomes brief conference/event announcements of interest to the IR and higher education communities.
Learn More 

AIR Hub

Recent Discussions

Listings Closing Soon

Total jobs: 3
Job Title Institution Location Salary Range Application Due Date Control Column
Title V Data Research Analyst Mount Saint Mary's University, Los Angeles CA Dependent on qualifications and experience 2024-06-30
Director, Academic Effectiveness University of San Diego CA $8583 - $11666 2024-06-07
Institutional Research Analyst Adelphi University NY $62500 - $67500 2024-06-02