Forum Discussion

RaquelNC's avatar
RaquelNC
Copper Contributor
Oct 21, 2022
Solved

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...
  • JKPieterse's avatar
    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();
    	}
    }

Resources