Solved

VBA code to clear all filter and select

Posted on 2016-11-09
1
48 Views
Last Modified: 2016-11-19
Hi,

I have a very simple vba code where i want to first clear all filters in the slicer then select RB. Below is the code i am using but no success. can anyone help?

   
    ActiveWorkbook.SlicerCaches("Slicer_Manufacturer1").ClearManualFilter
   
    With ActiveWorkbook.SlicerCaches("Slicer_Manufacturer1")
   .SlicerItems("RB").Selected = True

End With
End Sub
0
Comment
Question by:Dokat
1 Comment
 
LVL 48

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 41881744
HI,

pls try

for each slcCache in ActiveWorkbook.SlicerCaches
    slcCache.ClearManualFilter
Next
     
With ActiveWorkbook.SlicerCaches("Slicer_Manufacturer1")
    .SlicerItems("RB").Selected = True
End With
 End 

Open in new window

Regards
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

Modern/Metro styled message box and input box that directly can replace MsgBox() and InputBox()in Microsoft Access 2013 and later. Also included is a preconfigured error box to be used in error handling.
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
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 …

747 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

12 Experts available now in Live!

Get 1:1 Help Now