I have an Excel sheet, which is filtered with slicers and contains a column with checkboxes. I would like to create a script which reverses the values of the visible checkboxes.
I'm new to TypeScript, but I've constructed the basic structure. Problem is; because the column contains a header, I need to check the cellValuecellValue for a checkbox, before I flip the value. Unfortunately, typeOftypeOf only returns "object" and checking with instanceOfinstanceOf didn't work either. WhatWhat would be the best approach to identify cells only with CheckBoxescheckboxes?
Thanks in advance
function main(workbook: ExcelScript.Workbook) { let selectedSheet = workbook.getActiveWorksheet(); // get all the visible cells in the 'complete' column let visibleCheckboxes = selectedSheet.getRange("F:F") .getUsedRange() .getSpecialCells(ExcelScript.SpecialCellType.visible) // itterateiterate throughover the all the checkboxes and flip their value visibleCheckboxes.getAreas().forEach((range) => { // mulitple ranges as we're filtering range.getValues().forEach(cellValue => { console.log(typeof cellValue) // if cellValue is a checkbox // flip value }); }); }