Microsoft Office Online
Sign in to My Office Online (What's this?) | Sign in

 
 
Help and How-to
Search
Search
 
 
 
 
Warning: You are viewing this page with an unsupported Web browser. This Web site works best with Microsoft Internet Explorer 6.0 or later, Firefox 1.5, or Netscape Navigator 8.0 or later. Learn more about supported browsers.

Insert the filename in a cell
 
Applies to
Microsoft Excel 2000

To insert the filename with the path and sheet name, type the following function in a cell:

=CELL("filename")

To insert just with filename, without the path or sheet name, copy the following formula into a cell:

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

Notes

  • If you change the filename, you may need to press F9 to calculate the worksheet, and update the result of the function.
  • The above formulas return the name and path of the active workbook, not the workbook containing the function.
advertisement