I'm trying to display my worksheet name in cell A1. I checked the FAQs the but the one listed on this subject isnt working for me. Any help? I would like to use a formula vs VBA.
Glenn is correct. [purple]Cell("Filename")[/purple] gives the full path, right down to the sheet name, but only if the workbook has been saved. To extract the sheet name needs something like ..
-------------------------------------------------------------------------------------------- We want to help you; help us to do it by reading this: Before you ask a question.
Rgds, Geoff [blue]Experience is something you don't get until just after you need it[/blue]
We want to help [red]you[/red] Help us by reading this FAQ 1st faq222-2244
-------------------------------------------------------------------------------------------- We want to help you; help us to do it by reading this: Before you ask a question.
Thanks to everyone....
Dan's solution works just fine. I only wanted the worksheet name because I needed it for another formula reference (dynamic). Since I'm not so advanced on the VB I wanted a forumula without all the other junk (path etc).
If you'd actually read the FAQ, you would've noticed that this FORMULA:
=RIGHT(CELL("FILENAME",F10),LEN(CELL("FILENAME",F10))-FIND("]",CELL("FILENAME",F10)))
returns the sheet name only
Dan's solution DOES use VBA - and also, if you want to continue using it, you should put
Code:
Application.Volatile
as the 1st line of code as otherwise, it will not update when you change the sheet name
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.