4

At the bottom of Google Sheet web application, there is an 'Add' button and '1000' is the default number of rows to be added. Can I change this default number?

  • 2
    I doubt it. You can use a script to do it. Example here. Use the Add Rows menu at the top. The script is in the comment in cell A1. – Tom Woodward Nov 7 '15 at 3:28
2

This is currently not possible, though it has been brought up on Google Forums here: https://productforums.google.com/forum/#!msg/docs/8cddwCdFn7w/SUmXk1N8YfAJ

0

Here's my workaround: I have set a hourly trigger to run below script on the Spreadsheet, which runs through all individual sheets, deleting all rows after the last content row.

// people accidentally press the button "add 1000 rows" at the bottom of the sheet. 
// Run this script every hour to clean that off the bottom of the sheet.
    function deleteBogusBottomRows(sheet) {
      var lastRow = sheet.getLastRow();
      var maxRows = sheet.getMaxRows();
      //Logger.log("last row with content is "+lastRow);
      if( lastRow < maxRows ) {
        // Rows start at "1" - this will delete the last rows, which have no content.
        sheet.deleteRows(lastRow + 1, maxRows - lastRow); 
      }
    }


function deleteBogusBottomRowsInAllSheets() {
  var sheets = SpreadsheetApp.getActive().getSheets();
  for (var i=0; i < ss.getNumSheets(); i++){
    deleteBogusBottomRows(sheets[i]);
  } 
}
  • This doesn't really address the matter at hand, though. Since this script could potentially be useful to someone, you can ask and answer your own question about getting rid of the "bogus" rows. – jonsca Jan 4 '17 at 23:51
  • I agree with the comment, however I really like this idea and will be implimenting it myself in several large sheets I maintain. Thank you! – STowslee Jan 5 '17 at 12:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.