Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

130
Views
Base values on drop down box

I have a code set for rows to Auto Archive to another tab. I currently have it set based on a true/false. I would like it to be based on Drop Down box.

Below is my code I currently have.

function onEdit(event) {
  // assumes source data in sheet named main
  // target sheet of move to named Completed
  // getColumn with check-boxes is currently set to column 11 or K
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var s = event.source.getActiveSheet();
  var r = event.source.getActiveRange();

  if(s.getName() == "ACTIVITY REPORT" && r.getColumn() == 11 && r.getValue() == true) 
 {
    var row = r.getRow();
    var numColumns = s.getLastColumn();
    var targetSheet = ss.getSheetByName("Activity Archive");
    var target = targetSheet.getRange(targetSheet.getLastRow() + 1, 1);
    s.getRange(row, 1, 1, numColumns).moveTo(target);
    s.deleteRow(row);
  }
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Maybe this:

function onEdit(e) {
  const sh = e.range.getSheet();
  if (sh.getName() == "ACTIVITY REPORT" && e.range.columnStart == 11 && e.value) {
    const tsh = e.source.getSheetByName("e.value");
    const trg = tsh.getRange(tsh.getLastRow() + 1, 1);
    sh.getRange(e.range.rowStart, 1, 1, sh.getLastColumn()).moveTo(trg);
    sh.deleteRow(e.range.rowStart);
  }
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!