Sunday, 16 November 2014

Excel / Google Spreadsheet utilities

Generate a list of sheet names in the workbook (google spreadsheets only)

- https://productforums.google.com/forum/#!topic/docs/-2mGCzmUIkY

function sheetnames() {
  var out = new Array()
  var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets();
  for (var i=0 ; i<sheets.length ; i++) out.push( [ sheets[i].getName() ] )
  return out  
}


Retrieving a specific cell value from other sheets

https://productforums.google.com/forum/#!topic/docs/YwfiGQpg5LI

Sheet name with no space:
=Sheet1!A1

Sheet name with space
='Sheet Name'!A1


Use string value from a cell to access worksheet of same name

http://stackoverflow.com/questions/16899175/excel-use-string-value-from-a-cell-to-access-worksheet-of-same-name

e.g. cell A5 has the string value of the worksheet name
=INDIRECT("'"&A5&"'!G7")