In your Excel file press AltF11, which opens Microsoft Visual Basics for Applications (VBA) In VBA select Insert > Module and paste the following code Public Function GetMyProp(prop As String) As String GetMyProp = ThisWorkbookBuiltinDocumentProperties(prop) End Function In your Excel file type formula =GetMyProp("Title") This will showInsert current file name or path in a cell with Formula With the following formulas, you can quickly insert file name or path or sheetname in a speicfied cell Item Formula Example Filename only =MID (CELL ("filename"),SEARCH (" ",CELL ("filename"))1, SEARCH ("",CELL ("filename"))SEARCH (" ",CELL ("filename"))1) products featuresxlsxThe Excel CELL function returns information about a cell in a worksheet The type of information to be returned is specified as info_type CELL can get things like address and filename, as well as detailed info about the formatting used in the cell
Function Get Filename From File Path Iaccessworld Com