Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert filename or filepath into Excel cell

Status
Not open for further replies.

Anna22

Technical User
Feb 11, 2002
56
GB
Hi

Im not sure if this is possible but i would like to be able to put a reference to the filename and/or filepath in random cells on an excel template.

I know you can put the filename into the header or footer using page setup but was wondering if there is a way of putting it into a cell.

Word has the facility by using Insert --> Field and you can select it from there, is there a samilar option in Excel.

I dont know if it makes any difference but i have Excel 2003

Regards Anna
 
=CELL("filename",A1)
give you the full path, including sheet name.

If you just want the file name but no path etc.

=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND("]",CELL("filename",A1))-FIND("[",CELL("filename",A1))-1)


 
Please have a look in the FAQs section before posting questions: faq68-2561

Rgds, Geoff

Well, he's kind of had it in for DPlank ever since he accidentally ran over his dog. Actually, replace "accidentally" with "repeatedly," and replace "dog" with "son."

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top