Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, and 2016. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Returning a Worksheet Name.
by Allen Wyatt
(last updated February 6, 2016)
Looking for a way to put the name of your worksheet directly into a cell? Excel makes this easy through the use of the CELL function. If you include the following in a cell, Excel returns the full path of the workbook, along with the sheet name:
For instance, if you entered this into a cell in the Sheet1 worksheet of the MyWB workbook, the information returned by Excel might be something like C:\My Documents\[MyWB.xls]Sheet1 (depending, of course, on the drive and directory in which the workbook is saved).
To return just the worksheet name from this value, you could use the following in your cell:
This will work for any worksheet name up to 50 characters in length. (If you routinely use different lengths, simply change the value in the formula.) Continuing the earlier example, Excel would return Sheet1 as the result.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (11766) applies to Microsoft Excel 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Excel here: Returning a Worksheet Name.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
Excel allows you to "freeze" rows in your worksheet. What if you want the rows that are frozen to change as you scroll ...Discover More
If you have a lot of worksheets in workbook, finding the exact one you want can be a bit tricky. This tip looks at ...Discover More
If you are using a macro to process a number of worksheets, you may have a need to know if the worksheet is empty or not. ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.