Google Sheet Radio Button from Checkbox

    0

    4

    Guntar Susatyo

    Emulate radio button behavior from checkboxes

    Shortcut: sheetRadioButtonFromCheckbox

    function onEdit(e) {
      const row = e.range.getRow();
      const col = e.range.getColumn();
      
      if (col === 1  && row > 2 && row < 100 && e.source.getActiveSheet().getName() === "RekapPembelajaran" ) {
        if (e.source.getActiveSheet().getRange(row, 1).getValue() === true) {      
          e.source.getActiveSheet().getRange('A3:A164').setValue(false);
          e.source.getActiveSheet().getRange('A3:A164').setBackground(null).setFontColor('black');
          e.source.getActiveSheet().getRange(row,1).setValue(true);
          e.source.getActiveSheet().getRange(row,1).setBackground('#666666').setFontColor('#efefef');
          e.source.getActiveSheet().getRange('K4').setValue(e.source.getActiveSheet().getRange(row, 2).getValue());
        } 
      }
    }
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.