Print File Name

mattski72

New Member
Joined
May 16, 2011
Messages
1
I would like to have the file name update and print in a cell. I know how to get it to print in the header/footer area, but not in a cell. Thanks for your help.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Welcome to the forums!

Try:

<b>Excel 2007</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style=";">TestFile.xlsm</td></tr></tbody></table><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style="background-color: #E0E0F0;text-align: center;color: #161120"><th><b>Sheet1</b></th></tr></td></thead></table><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">A1</th><td style="text-align:left">=MID(<font color="Blue">CELL(<font color="Red">"filename"</font>),FIND(<font color="Red">"[",CELL(<font color="Green">"filename"</font>)</font>)+1,FIND(<font color="Red">"]",CELL(<font color="Green">"filename"</font>)</font>)-FIND(<font color="Red">"[",CELL(<font color="Green">"filename"</font>)</font>)-1</font>)</td></tr></tbody></table></td></tr></table><br />
 
Upvote 0
Code:
=MID(CELL("filename"), FIND("[", CELL("filename"))+1, FIND("]", CELL("filename"))- FIND("[", CELL("filename")) -1)
If you have more that one workbook open, the above formula displays the name of the last workbook altered.
The below formula will display the workbook name that the formula exist in.
Code:
=REPLACE(LEFT(CELL("filename",A1),FIND("]",CELL("filename",A1))-1),1,FIND("[",CELL("filename",A1)),"")
-or- without the ".xlsm"
Code:
=REPLACE(LEFT(CELL("filename",A1),FIND("]",CELL("filename",A1))-6),1,FIND("[",CELL("filename",A1)),"")
 
Upvote 0
Code:
=MID(CELL("filename"), FIND("[", CELL("filename"))+1, FIND("]", CELL("filename"))- FIND("[", CELL("filename")) -1)
If you have more that one workbook open, the above formula displays the name of the last workbook altered.
The below formula will display the workbook name that the formula exist in.
Code:
=REPLACE(LEFT(CELL("filename",A1),FIND("]",CELL("filename",A1))-1),1,FIND("[",CELL("filename",A1)),"")
-or- without the ".xlsm"
Code:
=REPLACE(LEFT(CELL("filename",A1),FIND("]",CELL("filename",A1))-6),1,FIND("[",CELL("filename",A1)),"")

Thanks for catching that!
 
Upvote 0

Forum statistics

Threads
1,217,415
Messages
6,136,506
Members
450,016
Latest member
murarj

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top