Subscribe!

Q:
Hi,
Can you tell me how to show the worksheet name in a cell in my workbook?
Thanks,
Ted

A:
Ted,
You can do this with the built in functions in Excel. The CELL function with the filename argument, =cell(“filename”), will return the entire path of your workbook along with your current worksheet. We can then extract the worksheet name by using the additional functions MID, FIND and LEN. The formula below will return just the worksheet name:

=MID(CELL(“filename”), FIND(“]”,CELL(“filename”))+1, LEN(CELL(“filename”))-FIND(“]”, CELL(“filename”)))

This can be very useful when setting up templates or for writing formulas that refer to other sheets.

Keep those questions coming in!

Joseph Harris
ExcelYogi.com

Related posts:

  1. Excel CELL () Function The CELL function can be used to find out information...
  2. Removing Macros from a Workbook Q: How do I remove all the macros from my...

This entry was posted on Wednesday, October 29th, 2008 at 9:02 pm and is filed under Mail Bag. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Response to “Excel Function to Display Worksheet Name”

  1. Analyst Pulpit » Blog Archive » Excel CELL () Function on November 20th, 2008 at 10:13 am

    [...] that is often used in conjunction with other functions to do some very interesting things. In this articles we talk about using the cell function to return the workbook name. [...]

Leave a Reply

You must be logged in to post a comment.