Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

202
Vistas
Archive rows going to very bottom of sheet. Not right under last row

enter image description hereI have the below code working in apps script. It does what it is supposed to as in auto archiving and deleting the rows when a checkbox is selected. The only hiccup is it is archiving the rows to the very bottom of the archive sheet, not right under the last archived row. It skips a lot of blank rows for some reason.

function onEdit(e) {
  const sh = e.range.getSheet();
  if (sh.getName() == "ACTIVITY REPORT" && e.range.columnStart == 1 && e.value == "TRUE") {
    var tsh = e.source.getSheetByName("Archive");
    var target = tsh.getRange(tsh.getLastRow() + 1, 1);
    sh.getRange(e.range.rowStart, 1, 1, sh.getLastColumn()).moveTo(target);
  }
  if (sh.getName() == 'Archive' && e.range.rowStart > 1 && e.range.columnStart == 11 
&& (e.value == 'NP CND A ACCEPTED' || e.value == 'NP BACKGROUND')) {
    SpreadsheetApp.flush();
    e.range.offset(0, 16).setValue(new Date());
  }
  if (sh.getName() == 'Archive' && e.range.rowStart > 1 && e.range.columnStart == 11) 
    {
    let ops = ['NP CND A ACCEPTED', 'NP BACKGROUND', 'HIRED INTERN-SP', 'HIRED SDR- 
  SP', 'HIRED', 'HIRED INTERN', 'HIRED SDR', 'HIRED SDR', 'NP AS', 'NP LDR', 'NP CND A 
  AR', 'NP CND A OFFER', 'NO SHOW', 'NP ORL', 'NP CND A Zoom Int', 'NP CND A 1 FL'];
    if (~ops.indexOf(e.value)) {
      e.range.offset(0, 14).setValue(new Date());
    }
  }
  }
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda