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

169
Vistas
OnEdit function with google Spreadsheet

I am still a newbie in this, but I want to run Onedit function script on google spreadsheet in a way that I will only get value on column E if the value on column D is "completed" and at the same time I will get value on column F depending on the value on B1 ( and that's only if the column D is"completed"). here is my spreadsheet: https://docs.google.com/spreadsheets/d/1-xLH3mb0fGngocOleCNExEmP6FnDMEFg2uLFXC10XEk/edit#gid=0

function onEdit(e){
    var s = SpreadsheetApp.getActiveSpreadsheet();
    if( s.getName() == "Hub" ){ 
    var r = s.getActiveCell(); 
    if (r.getColumn() == 4) {
    var timecell = r.offSet(0, 1);
    var assldapv = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Hub").getRange("B1").getValue(); 
    var assldapo = r.offset(0, 2);   
    if ( r.getValue() === 'completed' ) {
    timecell.setValue(new Date());
    assldapo.setValue(assldapv); }

However this function is not working, so can you please give me a template on how to proceed with such script.

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

0

Try this

function onEdit(e) {
  var sh = e.range.getSheet();
  if (sh.getName() == "Hub" && e.range.columnStart == 4 && e.value == "completed") {
    var timecell = e.range.offSet(0, 1);
    var assldapv = sh.getRange("B1").getValue();
    var assldapo = e.range.offset(0, 2);
    timecell.setValue(new Date());
    assldapo.setValue(assldapv);
  }
}
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