View difference between Paste ID: vVasrXy1 and J4FeRTBF
SHOW: | | - or go back to the newest paste.
1
function acraCleanup() { 
2
  var SPREADSHEET_KEY = "BBBBBV9AAAAAAGJGZVQ0Z2M0WnFDSAFAGACWFUMUE";
3
4
// Replace with your spreadsheet Key,
5
6
//you can find this by trying to share the Spread sheet
7
8
// and getting the key between the "=" and the "&" 
9-
  var SHEET_NAME = "Sheet 1"; //Sheet 1 unless you changed sheet name 
9+
  var SHEET_NAME = "Sheet1"; //Sheet1 unless you changed sheet name 
10
  var rowsToKeep = 1000; //Will keep bottom 1000 Rows 
11
  var sheet  = SpreadsheetApp.openById(SPREADSHEET_KEY).getSheetByName(SHEET_NAME); 
12
  var rows = sheet.getLastRow(); 
13
  var numToDelete = rows - rowsToKeep - 1; 
14
  if (numToDelete > 0) sheet.deleteRows(2, numToDelete); 
15
}