=MID(CELL("filename"),SEARCH("[",CELL("filename"))+1, SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))-1)
Insert the current Excel file name, path, or worksheet in a cell - Microsoft Support
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
EXCEL. How do I insert the filename into the Header. I have inserted =CELL("filename") but nothing happens.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
=MID(CELL("filename"),SEARCH("[",CELL("filename"))+1, SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))-1)
Insert the current Excel file name, path, or worksheet in a cell - Microsoft Support
EXCEL. How do I insert the filename into the Header. I have inserted =CELL("filename") but nothing happens.
Header & Footer tab
Header & Footer Elements group
Click:-
File Path
- or click:-
File Name
- depending upon your requirement.
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more
If anybody’s interested I’ve just posted a Forum Article about this topic here:-
How to insert a File Path or a File Name into an EXCEL Header
- providing the full step by step process.