This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generatePdf() { | |
var ss, source, newTab, newSheet; | |
source = SpreadsheetApp.openById("10wh47mXtvXEdfgdfgdfgdfgdfgdfg").getSheetByName('PrintFATURAFINAL'); | |
ss = SpreadsheetApp.openById("10wh47mXtvXEVUHdfgdfgdfgdfgdfgdfgd"); | |
var pdfName = source.getRange('E10').getDisplayValue(); | |
/*By using the value on a cell as the name for pdf file you be dynamically changed it to be display as a distinct list with no repetition | |
ei: client A.pdf | |
client B.pdf | |
,etc... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getFilesAndFolder() { | |
//Get File by ID | |
var file=DriveApp.getFileById("1_eYdGILxexc7JVJGeKjdcGk-lSwawHTgb12boCWIfF4"); | |
Logger.log(file) | |
//Get Folder by ID and get list of files inside it | |
var files=DriveApp.getFolderById("0Bz7xEwadCXkXSUVhODdGRHVnUkk").getFiles(); | |
while(files.hasNext()) | |
{ | |
Logger.log(files.next()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function replaceCommasDots() { | |
var id = ''; /* Your spreadsheet id (value after /id/*): https://docs.google.com/spreadsheets/d/:id/edit */ | |
var sheet = SpreadsheetApp.openById(id); | |
var range = sheet.getRange("A1:B2"); /* range you want to modify */ | |
var data = range.getValues(); | |
for (var row = 0; row < data.length; row++) { | |
for (var col = 0; col < data[row].length; col++) { | |
data[row][col] = (data[row][col]).toString().replace(/,/g, '.'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function deleteRows() { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var rows = sheet.getDataRange(); | |
var numRows = rows.getNumRows(); | |
var values = rows.getValues(); | |
var rowsDeleted = 0; | |
for (var i = 0; i <= numRows - 1; i++) { | |
var row = values[i]; | |
if (row[0] == 'delete' || row[0] == '') { // This searches all cells in columns A (change to row[1] for columns B and so on) and deletes row if cell is empty or has value 'delete'. |