Solved

Clear filters from slicers

Posted on 2014-07-31
3
183 Views
Last Modified: 2014-08-05
I have a slicer named Sales Team in my worksheet, can i have a line of code that just clears that slicer?

Thanks
0
Comment
Question by:Seamus2626
  • 2
3 Comments
 
LVL 31

Expert Comment

by:Rob Henson
ID: 40232169
Do you really need code?

There should be a Filter symbol at the top of the slicer selection list which clears the selection.

Thanks
Rob H
0
 
LVL 16

Expert Comment

by:Jerry Paladino
ID: 40232934
The code below should clear a specific slicer.  You will need to go into Slicer Settings for your Sales Team slicer to get the name to use in formulas.  In the code below and the picture it is "Slicer_Sales_Type41".

Sub Clear_Slicer()

    Dim scLong As SlicerCache
    Dim wb As Workbook
    
    Set wb = ThisWorkbook
    Set scLong = wb.SlicerCaches("Slicer_Sales_Type41")
    
    scLong.ClearManualFilter

End Sub

Open in new window

Slicer Settings to find Formula Name
0
 
LVL 16

Accepted Solution

by:
Jerry Paladino earned 500 total points
ID: 40233932
If you want the above in a single statement...
ThisWorkbook.SlicerCaches("Slicer_Sales_Type41").ClearManualFilter

Open in new window

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now