Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function acraCleanup() {
- var SPREADSHEET_KEY = "BBBBBV9AAAAAAGJGZVQ0Z2M0WnFDSAFAGACWFUMUE";
- // Replace with your spreadsheet Key,
- //you can find this by trying to share the Spread sheet
- // and getting the key between the "=" and the "&"
- var SHEET_NAME = "Sheet1"; //Sheet1 unless you changed sheet name
- var rowsToKeep = 1000; //Will keep bottom 1000 Rows
- var sheet = SpreadsheetApp.openById(SPREADSHEET_KEY).getSheetByName(SHEET_NAME);
- var rows = sheet.getLastRow();
- var numToDelete = rows - rowsToKeep - 1;
- if (numToDelete > 0) sheet.deleteRows(2, numToDelete);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement