Forum Discussion
liverlarson
Sep 18, 2020Brass Contributor
workbook and sheet name via formula
I have a standard header I put on almost every excel workbook I create I have been using for years. It includes several standard items, including Workbook name and Worksheet name, which are extracted...
- Sep 18, 2020
Afraid for Excel Online that's only with Office Script, there are properties getName both for workbook and worksheet.
VBA and related functions don't work in Excel Online.
MikeFromCanada
Feb 20, 2024Copper Contributor
Looking for single quotes won't work in all cases. I found out just last week that Excel only requires the single quotes for sheets with spaces or that begin with numbers.
Best I've been able to do is:
IFERROR( [formula that works other than Excel Web App] ,
"Formula doesn't work in Excel for the Web").
Admittedly it doesn't solve the Web problem, but at least tells the user what's going on...
Addendum: REALLY impressed with your response generally, let alone that you translated it into a second language.
Jan_Wijninckx
Feb 26, 2024Brass Contributor
The best solution which has been listed high above y someone else remains:
=SUBSTITUTE( SUBSTITUTE( TEXTBEFORE( FORMULATEXT(D1), "!"), "'", "" ), "=", "")
With D1 containing e.g.:
='3 Sheet 3'!D2
This works for sheet names like "3 Sheet" or "Sheet 3" or "Sheet3" And resolves the single quotes or not single quotes.
Very simple, very elegant
=SUBSTITUTE( SUBSTITUTE( TEXTBEFORE( FORMULATEXT(D1), "!"), "'", "" ), "=", "")
With D1 containing e.g.:
='3 Sheet 3'!D2
This works for sheet names like "3 Sheet" or "Sheet 3" or "Sheet3" And resolves the single quotes or not single quotes.
Very simple, very elegant