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

226
Visualizações
How to search for yesterday's date in a row, then copy / paste values to new Google Sheet

I have a Google Sheet (let's call it Sheet A) with Date, Sku ID and Copy ID columns (among others). I would like to write a bit of JavaScript in Apps Script that will search the Date column of Sheet A for yesterday's date, then copy that cell, plus the Sku ID and Copy ID from that row into another sheet (Sheet B).

I already have a function that adds new rows to Sheet B, I just need to copy the data from yesterday into those new rows.

Right now my thought process is:

  • Get yesterday's date and set it as a variable
  • Set source variable as a range from Sheet A (Date column, which is column A)
  • Search that source for yesterday's date
  • Copy date value, Sku ID and Copy ID
  • Paste to Sheet B

Am I on the right track? Any pointers on how to actually write that? Am I over complicating/simplifying?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Finding yesterdays rows

function lfunko() {
  const ss = SpreadsheetApp.getActive();
  const sr = 2;//data start row
  const sh = ss.getActiveSheet();
  const[hA,...vs] = sh.getDataRange().getValues();//assume one header
  const ydv = new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate()-1).valueOf();
  vs.foEach((r,i) => {
    let dt = new Date(r[0]);
    let dtv = new Date(dt.getFullYear(),dt.getMonth(),dt.getDate()).valueOf();
    if(ydv == dtv) {
      //this is one of yesterdays rows
      //row is i + sr
    }
  })
}
about 4 years ago · Juan Pablo Isaza Relatório
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