Last active
July 9, 2021 15:51
-
-
Save ehershey/1ea9552cfadbe43bba4abad1213b24a4 to your computer and use it in GitHub Desktop.
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
// Google Sheets Script | |
// | |
// 1. In the Tools Menu, select "Script Editor" | |
// 2. Paste this in replacing all text in the script editor | |
// 3. Click disk icon to "Save Project" | |
// 4. Refresh spreadsheet | |
// 5. Be patient and a new "Custom" menu will appear | |
// | |
// add a single row to every sheet in the current spreadsheet | |
function addRowToEverySheet() { | |
var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets(); | |
for (var i = 0; i < sheets.length; i++) { | |
sheets[i].appendRow([""]); | |
} | |
} | |
// add a menu item to call the function that adds a single row to every sheet in the current spreadsheet | |
function onOpen() { | |
SpreadsheetApp.getActiveSpreadsheet().addMenu("Custom", [{name: "Add row to every sheet", functionName: "addRowToEverySheet"}]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment