file name and path in worksheet
The file *must* have been saved at least once before these will work.
For the file name:
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND("]",CELL("filename",A1))-FIND("[",CELL("filename",A1))-5)
The reference to cell A1 can be *any* cell reference on that sheet.
For the path which includes the file name:
=LEFT(CELL("filename",A1),FIND("]",CELL("filename",A1)))
For the path excluding the file name:
=LEFT(CELL("filename",A1),FIND("[",CELL("filename",A1))-1)
Note that "filename" is the argument and not a placeholder. Some folks see
"filename" and think they need to replace that with the actual file name! Do
not replace "filename".
--
Biff
Microsoft Excel MVP
"april" wrote in message
...
is there a way to insert the file name and path in a worksheet - i'm not
talking about the footer in the print setup. i am looking for something
like
the NOW function.
thanks
--
aprilshowers
|