generate functionThu, 26 Jan 2023

a descrição abaixo é referente a uma planilha google quanto eu editar a coluna Q da aba Página1, preciso preencher as seguintes células da mesma linha (todos os exemplos a seguir são referentes à linha 3): 1) L, com o valor correspondente ao resultado da fórmula =TODAY() 2) M, com o valor equivalente ao resultado da fórmula =REPLACE(G3; 16; 10; "") 3) N, com o valor equivalente ao resultado da fórmula =REPLACE(G3; 1; 21; "") 4) O, com a palavra "peticionar" (mesmo se a célula já estiver preenchida) 5) R, buscando o conteúdo da célula editada na coluna A da aba dados e escrevendo o conteúdo da mesma linha da coluna B dessa mesma aba (somente se a célula destino estiver vazia) 6) W, buscando o conteúdo da célula editada na coluna A da aba dados e escrevendo o conteúdo da mesma linha da coluna F dessa mesma aba (mesmo se a célula já estiver preenchida)

function onEdit(e) { //uncomment the line below to see which columns are being edited //Logger.log(e); //set the sheet where the data is var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Página1"); //set the cell where the date should be inserted var cell = e.range.offset(0, -16); //if the column is Q, the row number is greater than 2 and the cell is empty if (e.range.getColumn() == 17 && e.range.getRow() > 2 && cell.isBlank()) { //set the date in the cell cell.setValue(new Date()).setNumberFormat("dd/MM/yyyy"); } //set the cell for the date cell = e.range.offset(0, -14); //if the column is Q, the row number is greater than 2 and the cell is empty if (e.range.getColumn() ==

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant