How do I Auto-populate Cell with SheetName in Excel 2007?

I am trying to auto populate a cell with the SheetName.  I have looked though countless examples but I have not been able to get any answers that work.  Does anyone know how to do this?

Example:

The Sheet Name (TabName) is named "Sheet1".  I want that value to be auto populated in Cell B1.

Thus, cell B1="Sheet1"

Answer
Answer
As long as the workbook is saved, these formulas return the sheet name:

=MID(CELL("filename",$A$1),FIND("]",CELL("filename",$A$1))+1,255)
or
=REPLACE(CELL("Filename",A1),1,FIND("]",CELL("filename",A1)),"")

Is that something you can work with?
Ron Coderre
Microsoft MVP - Excel (2006 - 2010)

P.S. If any post answers your question, please mark it as the Answer (so it won't keep showing as an open item.)
Regards,

Ron Coderre
Former Microsoft MVP - Excel

17 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated December 1, 2023 Views 13,517 Applies to: