A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

formula to get sheet name



 
 
Thread Tools Display Modes
  #1  
Old September 15th, 2005, 09:34 PM
Nigel
external usenet poster
 
Posts: n/a
Default formula to get sheet name

hi,

can a formula retreive a worksheet name or does it need to be macro based?


thanks,


N.S.
  #2  
Old September 15th, 2005, 09:41 PM
KL
external usenet poster
 
Posts: n/a
Default

Hi Nigel,

This formula that takes care of the possible situation whereby you have only
one sheet in the workbook and its name is the same as the workbook's. Note:
CELL("filename") will only work if the file has been saved at least once and
if the file is opened in a different language system, the argument
"filename" will need to be changed manually to the corresponding word (e.g.
in Spanish "nombrearchivo"):

=LOOKUP(REPT("z",255),SUBSTITUTE(MID(CELL("filenam e"),1+FIND({"*","]"},SUBSTITUTE(CELL("filename"),"\","*",LEN(CELL("f ilename"))-LEN(SUBSTITUTE(CELL("filename"),"\","")))),255),". xls",""))

Regards,
KL



"Nigel" wrote in message
...
hi,

can a formula retreive a worksheet name or does it need to be macro based?


thanks,


N.S.



  #3  
Old September 15th, 2005, 09:45 PM
David Billigmeier
external usenet poster
 
Posts: n/a
Default

Copy the following code (Verbatim) into any cell (make sure the book is saved
first):

=RIGHT(CELL("filename"),LEN(CELL("filename"))-SEARCH("]",CELL("filename")))

--
Regards,
Dave
!--


"Nigel" wrote:

hi,

can a formula retreive a worksheet name or does it need to be macro based?


thanks,


N.S.

  #4  
Old September 15th, 2005, 09:47 PM
Chip Pearson
external usenet poster
 
Posts: n/a
Default

Nigel,

Try the following formula.
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,32)

The file must have been saved to disk in order for this to work.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Nigel" wrote in message
...
hi,

can a formula retreive a worksheet name or does it need to be
macro based?


thanks,


N.S.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Change sheet name in formula kojimm Worksheet Functions 2 July 6th, 2005 09:44 AM
Balance sheet Formula TC General Discussion 0 February 23rd, 2005 08:13 PM
Formula Help Vicki Worksheet Functions 3 September 3rd, 2004 09:18 PM
Sheet name in formula Kimberly Worksheet Functions 2 March 18th, 2004 06:17 PM
Sheet Names Joseph M. Yonek Worksheet Functions 6 January 3rd, 2004 02:15 AM


All times are GMT +1. The time now is 05:39 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.