filename function

D

Dennis

Is there a simple way to insert the filename (workbook
name ) within a cell? I have not found any function to
display the file name. I can insert the file name into a
header or footer, but not into a cell.

The reason that I want to do this, is that I create
biweekly reports. I use the Save-As option to create a
report from the previous one, each time I have to update
the cell that contains the file name by entering the new
filename. I can not believe that there is not a function
that I could use instead. Even in Word I can insert a
field to display the filename.

Any suggestions?

Dennis
 
F

Frank Kabel

Hi Dennis
try the following
File path and file name:
=CELL("filename",A1)

File path only
=LEFT(CELL("filename",A1),FIND("[",CELL("filename",A1),1)-1)

File name only
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1),1)+1,FIND("]",CEL
L("filename",A1),1)-FIND("[",CELL("filename",A1),1)-1)

The sheet name
=RIGHT(CELL("filename",A1),LEN(CELL("filename",A1))-FIND("]",CELL("file
name",A1),1))
 
J

JE McGimpsey

One way:

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top