Solved

Clear filters from slicers

Posted on 2014-07-31
3
184 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 32

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Search for a value in Column? 5 21
Delete texts with font color 16 30
excel connection properties parameters grayed out 5 25
Help with Excel formula 6 35
Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

914 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

21 Experts available now in Live!

Get 1:1 Help Now