Forum Discussion
RaquelNC
Oct 21, 2022Copper Contributor
Excel Script Assistance Clear All Slicers - conversion from VBA
Hello Community, If possible, I would like to create an Excel Script that replaces the VBA Code that I have assigned to current button in my Excel Workbook. Private Sub ClearFiltersButton...
- Oct 24, 2022
RaquelNC This script works for me:
function main(workbook: ExcelScript.Workbook) { let slicers = workbook.getSlicers(); for(let i=0;i<slicers.length;i++){ slicers[i].clearFilters(); } }
RaquelNC
Oct 24, 2022Copper Contributor
JKPieterse That works perfectly. Thanks for the assistance. I am working on assigning that script to my button to replace the old VBA. 🙂
JKPieterse
Oct 24, 2022Silver Contributor
There is an option in the script editor menu to add a button to your sheet that calls the script.
- RaquelNCOct 24, 2022Copper Contributor
JKPieterse I saw that after I added it to my script list and renamed it for the workbooks that I was working on. Thanks for reaching out to let me know. I greatly appreciate all the tips and tricks.