Skip to main content
added 61 characters in body
Source Link
ale
  • 52.9k
  • 42
  • 165
  • 314

There is no default way to do it through UI of google docsGoogle Spreadsheets. However, I have written a small script that you can use on your google docs spread sheetGoogle Spreadsheet to add rows.

function addRows(){
  var sheet = SpreadsheetApp.getActiveSheet();
  var rows = sheet.getDataRange();
  var numRows = rows.getNumRows();
  
  for (var i = 1; i <= numRows*2 - 1; i+=2) {
   sheet.insertRowAfter(i);
  }
}

To use this code, follow these steps.

In Google DocsSpreadsheets, navigate to Tools > Script ManagerTools > Script Manager.

enter image description herescreen shot from Google Spreadsheets showing menu option

Click NewNew in the next window, a blank code.gscode.gs file will be opened. Copy and Paste the above code in Code.gs and save the project.

Come back to the tab that contains your original document. Open script manager again if it is not already open. Click RefreshRefresh at top right. Now you will see the function addRows"addRows". In the screenshot you will see other function that I have created earlier, but you will only see one unless you already created some other function. Select it and click RunRun. Now rows will be inserted in your documentspreadsheet at once.

enter image description herelist of functions in script manager

There is no default way to do it through UI of google docs. However, I have written a small script that you can use on your google docs spread sheet to add rows.

function addRows(){
  var sheet = SpreadsheetApp.getActiveSheet();
  var rows = sheet.getDataRange();
  var numRows = rows.getNumRows();
  
  for (var i = 1; i <= numRows*2 - 1; i+=2) {
   sheet.insertRowAfter(i);
  }
}

To use this code, follow these steps.

In Google Docs, navigate to Tools > Script Manager

enter image description here

Click New in the next window, a blank code.gs file will be opened. Copy and Paste the above code in Code.gs and save the project.

Come back to the tab that contains your original document. Open script manager again if it is not already open. Click Refresh at top right. Now you will see the function addRows. In the screenshot you will see other function that I have created earlier, but you will only see one unless you already created some other function. Select it and click Run. Now rows will be inserted in your document at once.

enter image description here

There is no default way to do it through UI of Google Spreadsheets. However, I have written a small script that you can use on your Google Spreadsheet to add rows.

function addRows(){
  var sheet = SpreadsheetApp.getActiveSheet();
  var rows = sheet.getDataRange();
  var numRows = rows.getNumRows();
  
  for (var i = 1; i <= numRows*2 - 1; i+=2) {
   sheet.insertRowAfter(i);
  }
}

To use this code, follow these steps.

In Google Spreadsheets, navigate to Tools > Script Manager.

screen shot from Google Spreadsheets showing menu option

Click New in the next window, a blank code.gs file will be opened. Copy and Paste the above code in Code.gs and save the project.

Come back to the tab that contains your original document. Open script manager again if it is not already open. Click Refresh at top right. Now you will see the function "addRows". In the screenshot you will see other function that I have created earlier, but you will only see one unless you already created some other function. Select it and click Run. Now rows will be inserted in your spreadsheet at once.

list of functions in script manager

Source Link
Buddha
  • 460
  • 1
  • 3
  • 11

There is no default way to do it through UI of google docs. However, I have written a small script that you can use on your google docs spread sheet to add rows.

function addRows(){
  var sheet = SpreadsheetApp.getActiveSheet();
  var rows = sheet.getDataRange();
  var numRows = rows.getNumRows();
  
  for (var i = 1; i <= numRows*2 - 1; i+=2) {
   sheet.insertRowAfter(i);
  }
}

To use this code, follow these steps.

In Google Docs, navigate to Tools > Script Manager

enter image description here

Click New in the next window, a blank code.gs file will be opened. Copy and Paste the above code in Code.gs and save the project.

Come back to the tab that contains your original document. Open script manager again if it is not already open. Click Refresh at top right. Now you will see the function addRows. In the screenshot you will see other function that I have created earlier, but you will only see one unless you already created some other function. Select it and click Run. Now rows will be inserted in your document at once.

enter image description here