How to Delete Blank Rows with Google Apps Script #appshee t function onOpen() { var ui = SpreadsheetApp.getUi(); ui.createMenu('Delete Blank Rows') .addItem('Delete Blank Row Manually','deleteBlankRows' ) .addToUi(); } function deleteBlankRows() { var SS = SpreadsheetApp.getActiveSpreadsheet(); // Get sheets var sheets = SS.getSheets(); // Loop through sheets. Delete blank rows in each sheet. for (var s=0; s < sheets.length; s++) { var currentSheet = sheets[s]; var sheetName = sheets[s].getName(); var searchDataRange = currentSheet.getRange(1,1,currentSheet.getMaxRows(),currentSheet.getMaxColumns()); // get the ENTIRE sheet. not just where the data is. var searchValues = searchDataRange.getValues(); var numRows = searchValues.length; ...