Prompt Title: get Current Workbook Name and sheet

Created 1 year ago
Votes 0
Views 215 times
0

Prompt Detail:

To get the name of the current Google Sheets workbook, you can use the following formula:

=MID(CELL("filename"),FIND("[",CELL("filename"))+1,FIND("]",CELL("filename"))-FIND("[",CELL("filename"))-1)

This formula will extract the name of the current workbook from the full file path of the Google Sheet.

Alternatively, you can use the following custom function:

javascript
function getCurrentWorkbookName() { var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); return spreadsheet.getName(); }

To use this custom function:

  1. Open your Google Sheet.
  2. Go to the "Tools" menu and select "Script editor".
  3. In the Script Editor, paste the above code.
  4. Save the script (File > Save).
  5. Go back to your Google Sheet.
  6. In any cell, enter the following formula:

=getCurrentWorkbookName()

This will call the custom function and return the name of the current workbook.

avatar
lamin99
Shared 5 prompts
Created 1 year ago

Leave a Comment

Related Tag Prompts

84
0
0
0
Google Sheets SMS Script
11 months ago 2023-04-03 16:53:35 ben
0
0
Google Sheets: Filter and Move.
10 months ago 2023-04-30 01:42:22 richard bunce
0
0
Find and Delete Cell Content
10 months ago 2023-05-03 18:27:10 Ray Celeste
0
0
Adjusting Survey Prompt
6 months ago 2023-08-31 19:34:50 Tom