Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VBA code to clear all filter and select

Posted on 2016-11-09
1
Medium Priority
?
259 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 53

Accepted Solution

by:
Rgonzo1971 earned 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
Use Windows Task Scheduler to print a Word document weekly so your printer ink won't dry out.
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 in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

916 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