1

I'm trying to add more values with "Select a name" to the script so when any of these values pop up it'll clearcontent

function onEdit(e) {
  
  let range=e.range;
  let activeRow = range.getRow();
  let activeColumn = range.getColumn();
  let cellValue = range.getValue();
  let sheet = SpreadsheetApp.getActiveSheet();


    if (SpreadsheetApp.getActiveSheet().getSheetName() == 'PUBG Videos') {
    if (activeColumn == 26) {

      if (cellValue == "Select a name") {

          sheet.getRange(activeRow,25).clearContent();

      }

      else {

          sheet.getRange(activeRow,25).setValue(new Date());

      }
      }



    if (activeColumn == 31) {

      if (cellValue == false) {

          sheet.getRange(activeRow,32).clearContent();

      } else {

          sheet.getRange(activeRow,32).setValue(new Date());

      }

    }
}
}
0

1 Answer 1

0

With && you can add conditions to be met together and with || you can set conditions that will pass when at least one is met

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.