Solved

VBA code to clear all filter and select

Posted on 2016-11-09
1
75 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 50

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
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!
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

856 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