How To Insert Alternate Blank Rows in Google Sheets (manually or automatically using App Script)

Content

Step by Step Guide to Insert Alternate Blank Rows Manually in Google Sheet

insert alternate blank rows in google sheets
  1. Insert a new column
  2. Fill new column with number 1. You can ‘Ctrl’+drag the number to auto fill a series of number.
  3. Copy the numbers using ‘Ctrl+C’, and paste it using ‘Ctrl+V’.
  4. ‘Ctrl+A’ to select all the cells.
  5. Go to Data -> Sort Range -> Advanced range sorting options -> check on ‘Data has header row’ (if your data has header), and Sort by A-Z on column A (which is your new column)
  6. Then delete the new column, and you have inserted alternate blank rows in Google Sheets.

Step by Step Guide to Insert Alternate Blank Rows Automatically In Google Sheets Using App Script

Alternatively, you can use the following script in App Script to insert alternate blank rows automatically.

function InsertBlankRow() {
  var numRowsToInsert =1; //number of blank rows you want to insert
  var startRow =1; //the starting row of your data
  var aSheet = SpreadsheetApp.getActiveSheet();
  var endRow = aSheet.getLastRow();

  for (var i = endRow; i >= startRow; i--) {
    aSheet.insertRowsAfter(i,numRowsToInsert); 
  }
}

1. To access App Script on Google Sheets, go to Extension -> App Script

2. Copy and paste the above script onto AppScript window. Change the var numRowsToInsert to the number of blank rows you want to insert. And var startRow to the starting row of your data.

3. You can rename the project name. You need to save the project, before you can Run the script on your google sheet.

4. Once you have saved, click on the Run button. And follow the steps below to allow permission to run the script.

5. Once you have allowed permission, the script will run on your google sheet.