lundi 28 février 2022

How do I delete the cell content in front of cell that have not been checked?

I have cell range. First column have content. Second column have check box. See first picture.first picture I try to clear content infront of unchecked boxes.

    function clearCon() {
var ss = SpreadsheetApp;
var sheet=ss.getActiveSpreadsheet().getSheetByName ("AddData");
var chkval = sheet.getRange("A29:B33").getValues();
Logger.log(chkVal);
Logger.log( chkval.length);
for(var i=0; i<=chkVal.length; i++) { if (chkval[1][1] == false) { sheet.getRange (28, 1, 1+1,1).clearContent(); return;
Logger.log(1);
}
}
}

See this picture code it's not correctly work. How to do this?




Aucun commentaire:

Enregistrer un commentaire