How to insert file name or path into cell / header or footer in Excel?
Supposing you want to insert the file name or file path into Excel cell, header or footer, how could you quickly do this operation?
With the following formulas, you can quickly insert file name or path or sheetname in a speicfied cell.
|Filename only||=MID(CELL("filename"),SEARCH("[",CELL("filename"))+1, SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))-1)||products features.xlsx|
|Filepath only||=LEFT(CELL("filename",A1),FIND("[",CELL("filename",A1),1)-1)||C:\Users\dt\Desktop\New folder\|
|Active sheetname only||=RIGHT(CELL("filename"),LEN(CELL("filename"))-FIND("]",CELL("filename"),1))||Sheet7|
|Current filename, filepath and active sheetname||=CELL("filename")||C:\Users\dt\Desktop\New folder\[products features.xlsx]Sheet7|
1. Copy any above formula that you need to a specified cell, and you will get the result you need.
2. The opend workbook must have been saved.
If you want to insert the filename or filepath into the wotksheet header or footer, you can use the Header & Footer function.
1. On the Ribbon, click Insert > Header & Footer.
2. There will be three editing box in the Header or Footer section, click left, center or ringht box that you want to insert the filename or path. Then under the Design tab, click File Path, File Name or Sheet Name that you need to insert. See screenshot:
Then click any cell, and you can see the file path or name or sheet name has been inserted into the header ot footer. See screenshots:
|Insert the file path into the header|
|Insert the file name into the footer|
Kutools for Excel’s Insert Workbook Information is a mutifunctional tool, it can help you insert worksheet name, workbook name, workbook path or workbook path & name into the Excel cells, header or footer quickly and conveniently.
|Kutools for Excel, with more than 300 handy functions, makes your jobs easier.|
After installing Kutools for Excel, please do as below:(Free Download Kutools for Excel Now!)
1. Click Kutools Plus > Workbook Tools > Insert Workbook Information, see screenshot:
2. In the Insert Workbook Information dialog box, choose the workbook information you want to insert from left pane, and then select the place where you want to insert the information at. See screenshot:
3. Then click OK. If you insert the wotkbook information into a cell, you will get the result as follows:
If you insert the workbook information into the header or footer, you can choose the location where you want to insert the information into, Left, Right or Center. And you can preview the header or footer from View > Page Layout.
To know more about this feature, please visit Insert Workbook Information.
Batch insert blank rows or columns in a specific interval in Excel range
|If you want to insert blank rows in every other row, you may need to insert them one by one, but the Insert Blank Rows & Columns of Kutools for Excel can solve this job in seconds. Click for 30 days free trial!|
|Kutools for Excel: with more than 300 handy Excel add-ins, free to try with no limitation in 30 days.|
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!