Excel filename into cell

  • Thread starter Thread starter Jean-Paul De Winter
  • Start date Start date
J

Jean-Paul De Winter

Hi,

Is it possible to get the filename of an excel-file into cel A1?

Thanks
 
With a formula for a Saved file, there are various ways
such as:

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

above as one line

Or with vba,

Sub test2()

Range("A1").Value = ActiveWorkbook.Name
End Sub

Regards,
Sandy
 
Hi
Use (just insert the formulas as-is. Note: the workbook
has to be saved before)
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1),1)
+1,FIND("]",CELL("filename",A1),1)-FIND("[",CELL
("filename",A1),1)-1)
 
Thanks for the reply...
Tried to enter it in cell A1 but got an error ....
JP
Frank Kabel said:
Hi
Use (just insert the formulas as-is. Note: the workbook
has to be saved before)
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1),1)
+1,FIND("]",CELL("filename",A1),1)-FIND("[",CELL
("filename",A1),1)-1)
-----Original Message-----
Hi,

Is it possible to get the filename of an excel-file into cel A1?

Thanks


.
 

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

Back
Top