Forum Discussion
himmaugh
Sep 21, 2022Copper Contributor
How to add file name to excel document
was on dinosaur MS Office 2007; now on MS 365; my question is how to add the docūment file name to an excel worksheet; i remember doing this on the dinosaur so, I am assuming it can still be done; th...
DexterG_III
Sep 21, 2022Iron Contributor
himmaugh it sure can be. The filename is actually inside of brackets using the Cell("Filename") function so the formula below returns the location of those brackets and pulls everything in between them.
=MID(CELL("filename"),SEARCH("[",CELL("Filename"))+1,SEARCH("]",CELL("Filename"))-SEARCH("[",CELL("Filename"))-1)
Hope this helps.
Dexter