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

198
Vistas
How to get the Last updated item in Google sheets

I'm trying to find a solution online but it's not been fruitful so far, I want to fetch the data in Columns 1,2,3,4,5,6,7 that is last edited in Sheet1 and then feed it into Sheet2.

Giving you an example, If the data is edited in Sheet1 C2 that data should be added into Sheet2 in A2 and B2

What I'm trying to achieve is, if anyone updated Sheet one, I want to know the last update in Sheet 2, is it possible to do this via scrip?

Sheet1 Screenshot

enter image description here

Sheet2 Screenshot

enter image description here

I tried a lot of script editing and tried to modify it... so far nothing worked for me. :(

View Google Sheet

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

In your situation, how about the following sample Script?

Sample script:

Please copy and paste the following script to the script editor of Spreadsheet and save the script. When you use this script, please edit "Sheet1". By this, the script is run by the simple trigger of OnEdit.

function onEdit(e) {
  const range = e.range;
  const sheet = range.getSheet();
  if (sheet.getSheetName() != "Sheet1" || range.rowStart == 1) return;
  const col = range.columnStart - 1;
  const [header, ...values] = sheet.getDataRange().getValues();
  const value = values[range.rowStart - 2];
  const v = [[`${value[0]} - ${value[1]}`, `${header[col]} - ${value[col]}`]];
  e.source.getSheetByName("Sheet2").getRange("A2:B2").setValues(v);
}
  • For example, when the cell "C2" of "Sheet1" is edited, AB0002 - Orange and Price - ### are put to the cells "A2:B2" of "Sheet2".

Note:

  • This script is run by the simple trigger of OnEdit. So, when you directly run the script with the script editor, an error occurs. Please be careful this. Please edit "Sheet1". By this, the script is run.

  • This sample script is for your sample Spreadsheet. When you changed the structure of the Spreadsheet and the actual Spreadsheet is different from your sample one, this script might not be able to be used. Please be careful about this.

Reference:

  • Simple Triggers
about 4 years ago · Juan Pablo Isaza Denunciar
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