Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

Is there any way to display a sheet name as the result of a function in a google doc spreadsheet (exactly like this question, except in gspread)?

share|improve this question

migrated from superuser.com Jun 6 '11 at 15:58

This question came from our site for computer enthusiasts and power users.

3 Answers 3

up vote 8 down vote accepted

Someone has written a script to do this. It is available in Tools > Script gallery.... Search for sheet name and install the script, then use it with =getCurrentSheetName()

share|improve this answer
6  
How to access this script in the "new" Google Sheets (which now uses an add-on store)? –  Benjamin Mar 29 at 6:13

This works very well. I've tried without example, just with notes. Unique aditional note that is if you rename the page (Active Sheet), you must erase the funtcion in the cell and retype again, or del a char of function in the cell, of course, it returns an error, so you correct again, 'cause you change de name of active sheet , cell doesn't update the value in cell.

share|improve this answer

Please note that as of May 2014 there is still a known issue with accessing sheet names via api functions shown below - where it only returns the first sheet name. [1] If/when Google fixes the issue this method could be an easy solution.

Go to Tools > Script Editor and add this code:

function sheetName() {
  return SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getName();
}

In a cell where you want the sheet name add:

=sheetName()

[1] https://code.google.com/p/google-apps-script-issues/issues/detail?id=3522

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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