Refresh ALL Pivot Slicers on ActiveSheet only

JonesyUK

Board Regular
Joined
Oct 11, 2005
Messages
190
Office Version
  1. 365
Platform
  1. Windows
Dear All,

I am using the following to refresh ALL Pivot Slicers in ALL worksheets of my Workbook:

Sub Slicer()
Dim slcr As SlicerCache
For Each slcr In ActiveWorkbook.SlicerCaches
slcr.ClearManualFilter
Next slcr
Call Refresh
End Sub

Question: how do I get this to work on ONLY the Active Sheet??? i.e. I don't want it to run on all the pivots in the entire Workbook...

Many thanks,
JonesyUK
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
What do you mean by refresh a pivot slicer? The Refresh method applies to a PivotCache object not a SlicerCache object. What is your Refresh procedure do?
 
Upvote 0
I have 5 "Slicers" from my Pivot Table. The user can make a number of selections from these handy menus... All I am trying to do is have a button on the ActiveSheet which, when clicked, will "uncheck" all the Slicers that have selections.

Hope this makes sense... the code above works, but runs on all sheets in the workbook... i only need it to run on the active sheet....

Thanks,
 
Upvote 0

Forum statistics

Threads
1,225,169
Messages
6,183,311
Members
453,155
Latest member
joncaxddd

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top