Hello @K, Y ,
You can try something like this:
function main(workbook: ExcelScript.Workbook) {
// Get the current, active worksheet.
let worksheet = workbook.getActiveWorksheet();
let noCells = worksheet.findAll("Funktion_ausblenden", { completeMatch: true });
if (noCells) {
//Spalten ausblenden
noCells.getAreas().forEach(range => range.setColumnHidden(true));
}
}
worksheet.findAll()
returns a RangeAreas
object. Calling getAreas()
on this object can return an array of Range
objects, where you can iterate through and hide their columns accordingly.