Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Nigel
 
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   Report Post  
KL
 
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   Report Post  
David Billigmeier
 
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   Report Post  
Chip Pearson
 
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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Variable Sheet Name in Formula Barb R. Excel Discussion (Misc queries) 5 July 6th 05 06:20 PM
Can't get a formula to work in each row of an Excel sheet. JessicaMc Excel Worksheet Functions 2 June 8th 05 08:11 PM
Sheet name in formula SMullins Excel Worksheet Functions 3 April 8th 05 07:27 PM
Sheet name in formula SMullins Excel Worksheet Functions 8 April 8th 05 04:54 PM
Need formula for sheet & cell reference MPH Excel Worksheet Functions 0 January 16th 05 03:39 PM


All times are GMT +1. The time now is 02:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"