Copiar formula en columnas cada que se ingrese una fila en hoja de Excel

85 views
Skip to first unread message

Roberto Carlos Melgar

unread,
Jul 27, 2020, 3:46:34 PM7/27/20
to Google Apps Script Community
Buenas tardes a todos. me podrían ayudar por favor.
he creado un pequeño formulario con algunos campos tres de sus campos son 
Fecha formato dd/mm/aa 
Hora H:mm:00 
ahora en otra columna estoy uniendo la fecha y la hora con campo fecha + campo hora, pero cuando ingreso una nueva fila me gustaria que detecte que se ingreso una fila y que esas formulas se llenen automaticamente sin tener que ir a copiar y pegar la formula, como hago eso con gs google script 
por favor y les agradezco por la ayuda.
Rm

Darren D'Mello

unread,
Jul 28, 2020, 10:47:42 AM7/28/20
to google-apps-sc...@googlegroups.com
Could you share the file with us?

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/4c894cab-1f0f-4f2d-9f01-d87ebb526c2ao%40googlegroups.com.


--
Best,
Darren

Emerson Maia

unread,
Jul 28, 2020, 2:30:45 PM7/28/20
to google-apps-sc...@googlegroups.com
Boa tarde , segue um exemplo. 
function somaDatas(){
var ss = SpreedsheetApp.getActive()
var sheet1 = ss.getsheetByNamer("Sheet1")
var lestRow = sheet1.getLastRow()
var data = sheet1.getRange(2,1,lastRow - 1,3).getValues();
Logger.log(data)
var totalArray = []
data.forEach(function(row) {
var data1 = row[0]
var data2 = row[1]
var total = data1 + data
row.push(total)
totalArray.push([total])
Logger.log(row)
});
Logger.log(totalArra)
sheet1.getRange(2,4,lastRow -1, 1).setValues(totalArray)
}

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/4c894cab-1f0f-4f2d-9f01-d87ebb526c2ao%40googlegroups.com.


--
Emerson Maia 

Jean-Luc Vanhulst

unread,
Jul 28, 2020, 2:37:18 PM7/28/20
to google-apps-sc...@googlegroups.com
You can use:   

 sheet.getRange(2,4,lastrow-1,1).setFormulasR1C1( "=R[0]C[-2]+R[0]C[-1]" );


Roberto Carlos Melgar

unread,
Jul 28, 2020, 8:39:35 PM7/28/20
to google-apps-sc...@googlegroups.com

Roberto Carlos Melgar

unread,
Jul 28, 2020, 8:39:35 PM7/28/20
to google-apps-sc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages