dimanche 16 février 2020

Unchecking Checkboxes in Google Sheets

For the life of me I can't figure out how set it up. I would like the function to check the entire sheet... alternatively I do know which specific ranges (B5:B26; G5:G26...AF5:AF26) on a specific sheet, if i can't set it up for the entire sheet...

function setFalse()
{
var sheet = SpreadsheetApp.getSheetByName("Test");
var dataRange = sheet.getRange('A:AN28');
var values = dataRange.getValues();
for (var i = 0; i < values.length; i++)
{
  for (var j = 0; j < values[i].length; j++)
  {
    if (values[i][j] == true)
    {
      values[i][j] = false; // Modified
    }
  }
}
dataRange.setValues(values);

};



Aucun commentaire:

Enregistrer un commentaire