[javascript] ddd

Viewer

  1.         function salvarCopiaGuia() {
  2.           var ss = SpreadsheetApp.openById("10sS6iTxMA7EgROzYzRcmrv16_-j1qs2fjF_cd-Irmp0");
  3.          
  4.           var planilha = SpreadsheetApp.getActiveSpreadsheet();
  5.          
  6.           var pastaDestino = DriveApp.getFolderById("1eSUd3ubggcuw5KHSjDisbzGBTk5RW7uP");
  7.          
  8.           var data  = Utilities.formatDate(new Date(),Session.getScriptTimeZone(),"dd/MM/yyyy hh:mm:ss a");
  9.          
  10.           var nomeGuia = "Gastos" // nome_da_Guia
  11.          
  12.           var planilhaDestino = SpreadsheetApp.open(DriveApp.getFileById(planilha.getId()).makeCopy ("Copia " + data, pastaDestino));
  13.          
  14.           var guias = planilhaDestino.getSheets();
  15.          
  16.           for (= 0; i <guias.length; i++){
  17.             if (guias[i].getSheetName() != nomeGuia){
  18.               planilhaDestino.deleteSheet(guias[i]);
  19.             }
  20.           }
  21.           
  22.         }

Editor

You can edit this paste and save as new:


File Description
  • ddd
  • Paste Code
  • 26 Sep-2021
  • 761 Bytes
You can Share it: