CELL("filename")

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to find out the filename of a workbook to use in a function
I have 2 workbooks open, I put CELL("filename") in workbook 1, I then go to workbook 2 and press F9.
CELL("filename") in workbook 1 will now return the filename of workbook 2, I want it to still return the name of workbook 1. How do I do this? (apart from pressing SHIFT+F9 in workbook 2

Thanks
 
Use this

=CELL("filename",A1)

and make sure the workbooks are saved first

--

Regards,

Peo Sjoblom


Multiple said:
I'm trying to find out the filename of a workbook to use in a function.
I have 2 workbooks open, I put CELL("filename") in workbook 1, I then go to workbook 2 and press F9.
CELL("filename") in workbook 1 will now return the filename of workbook 2,
I want it to still return the name of workbook 1. How do I do this? (apart
from pressing SHIFT+F9 in workbook 2)
 
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))
 
Back
Top