Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

206
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda