Skip to content

Instantly share code, notes, and snippets.

@sauntimo
Created November 9, 2012 16:05
Show Gist options
  • Save sauntimo/4046515 to your computer and use it in GitHub Desktop.
Save sauntimo/4046515 to your computer and use it in GitHub Desktop.
Default spreadsheet code
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
var values = rows.getValues();
for (var i = 0; i <= numRows - 1; i++) {
var row = values[i];
Logger.log(row);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment