=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)
Hello try this.
Or this formula but I only tested it on excel 365 desktop
- Go to Tools > Script gallery....
- Search for "sheet name"
- Install the script
- Use it with =getCurrentSheetName().
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)
function sheetName() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
return sheet.getName();
}
Thank you - getting closer!!Sorry,
Try this one:
- Go to tools > Script Editor
- Write this function:
VBA Code:function sheetName() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; return sheet.getName(); }
- Save the script
- Return to your sheet
- Then enter =sheetName() into any cell
Thank you - getting closer!!
See attached.
Function copied in to the Script Editor but then get an error message saying "1:13:23 PM Error Attempted to execute sheetname, but it was deleted."
Any ideas??
function mySheetName() {
var key = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getName();
return key;
}
Once again I apologize.
I tested it here only with a tab.
Please test this:
- Go to tools > Script Editor
- Write this function:
VBA Code:function mySheetName() { var key = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getName(); return key; }
- Save the script
- Return to your sheet
- Then enter =mySheetName() into any cell