Solved

VBA code to clear all filter and select

Posted on 2016-11-09
1
57 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 49

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

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
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 …

895 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

14 Experts available now in Live!

Get 1:1 Help Now