This file contains 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
var C_COLS_LEAVE = 1; | |
var C_ROWS_LEAVE = 25; | |
function deleteEmptyCells() { | |
var file = SpreadsheetApp.getActive(); | |
var sheets = file.getSheets(); | |
for (var i = 0, l = sheets.length; i < l; i++) { deleteEmptyCellsSheet_(sheets[i]); } | |
return 0; | |
This file contains 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
height: 800 | |
scrolling: no | |
border: no |
This file contains 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 onEdit(event) | |
{ | |
// Change Settings: | |
//-------------------------------------------------------------------------------------- | |
var TargetSheet = 'Main'; // name of sheet with data validation | |
var LogSheet = 'Data1'; // name of sheet with data | |
var NumOfLevels = 4; // number of levels of data validation | |
var lcol = 2; // number of column where validation starts; A = 1, B = 2, etc. | |
var lrow = 2; // number of row where validation starts |
This file contains 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
// sample files are here: https://drive.google.com/drive/folders/1U4GrMHHyakOoCG3PVehkQD_AKADvFdVL | |
var C_FILE_TRIGGER_ID = ''; // Put your file id here if you plan to use it as Library | |
var C_SHEET_EVAL = '_Ini_'; | |
var C_RANGE_VALS = 'C2:D'; | |
var CCC_ = {}; // for holding constants | |
var C_DELIMETER1_NAME = 'STR_DELIMEER1'; | |
// get settings from named range | |
function getSettings_(getAgain) |
This file contains 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 exportSpreadsheet() { | |
//All requests must include id in the path and a format parameter | |
//https://docs.google.com/spreadsheets/d/{SpreadsheetId}/export | |
//FORMATS WITH NO ADDITIONAL OPTIONS | |
//format=xlsx //excel | |
//format=ods //Open Document Spreadsheet | |
//format=zip //html zipped | |
This file contains 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
/* | |
* Licensed to the Apache Software Foundation (ASF) under one | |
* or more contributor license agreements. See the NOTICE file | |
* distributed with this work for additional information | |
* regarding copyright ownership. The ASF licenses this file | |
* to you under the Apache License, Version 2.0 (the | |
* "License"); you may not use this file except in compliance | |
* with the License. You may obtain a copy of the License at | |
* |
This file contains 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
/* Done! | |
1. Copy multiple sheets between files with 1 click | |
2. Delete "copy of..." from sheet name. Leave original name if possible*. | |
3. Delete and recreate named ranges. Leave original name if possible. | |
4. Repair formulas → to prevent #N/A, #Ref errors | |
* no naming conflicts | |
*/ |
This file contains 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
// usage | |
function cars_importRef() { | |
var t = new Date(); | |
// YOUR CODE | |
Browser.msgBox('Done! The time to run function is ' + getTimeEllapse_(t)); | |
} | |
function getTimeEllapse_(t) | |
{ | |
var dif = new Date() - t; |
This file contains 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 getDataElementsFromSheet() | |
{ | |
var sheet = SpreadsheetApp.getActiveSheet(); // get active sheet | |
var range = sheet.getDataRange(); // get range object containing data | |
var data = range.getValues(); // write range data into array called data | |
getDataElements(data); // To see the result run function and press <Ctrl + Enter> | |
} | |
function getDataElements(data) | |
{ |
This file contains 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
/** | |
* Retrieves all the rows in the active spreadsheet that contain data and logs the | |
* values for each row. | |
* For more information on using the Spreadsheet API, see | |
* https://developers.google.com/apps-script/service_spreadsheet | |
*/ | |
function readRows() { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var rows = sheet.getDataRange(); | |
var numRows = rows.getNumRows(); |