Search results
To get the path to the current workbook without the workbook name, you can use a formula based on the CELL function and the TEXTBEFORE function. In the example shown, the formula in E5 is: =TEXTBEFORE (CELL ("filename",A1)," [") The result is a path without the filename like this: "C:\path\".
To get a full path and name for the current workbook, you can use the CELL function and a reference to any cell in the workbook. In the example shown, the formula is: =CELL("filename",A1) You must save the worksheet in order to get the a result.
To get a path to the current workbook, you can use a formula based on the CELL function, the TEXTBEFORE function, and the SUBSTITUTE function. In the example shown, the formula in E5 is: = SUBSTITUTE (TEXTBEFORE (CELL ("filename",A1),"]"),"[","") The result is a path and filename like this: "C:\examples\workbook.xlsx".
To get the path for an Excel file, you need to use the CELL function along with three more functions (LEN, SEARCH, and SUBSTITUTE). CELL helps you to get the complete path of the file including the file name and the worksheet name.
For example: Say I want to reference a worksheet located in the same directory as my currently active workbook. My current workbook is located at C:\My Documents\Sample.xls . In this scenario, I would want an Excel formula to return C:\My Documents\ .
12 sty 2014 · Correct path should be: ''E:\Project\SubFolder\Subfolder\[Workbookname.xlsx]Sheetname' 2) for correct path use formula =TRIM(INDIRECT(A1 & "!" & CELL("address",B26))) 3) or you can use following awful formula (it will add "\" for you): =TRIM(INDIRECT(LEFT(A1,FIND("[",A1)-1) & "\" & RIGHT(A1,LEN(A1)-FIND("[",A1)+1) & "!" & CELL("address",B26)))
Type or paste the following formula in the cell in which you want to display the current file name with its full path and the name of the current worksheet: =CELL ("filename") Insert the current file name and the name of the active worksheet.