View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Peo Sjoblom
 
Posts: n/a
Default Entering a filename as a variable into cell similar as for footer

Just for fun

=REPLACE(SUBSTITUTE(CELL("filename"),INFO("directo ry")&"[",""),FIND("]",SUBSTITUTE(CELL("filename"),INFO("directory" )&"[","")),255,"")

--

Regards,

Peo Sjoblom

Excel 95 - Excel 2007
Northwest Excel Solutions
www.nwexcelsolutions.com
"It is a good thing to follow the first law of holes;
if you are in one stop digging." Lord Healey


"Miguel Zapico" wrote in message
...
You can use the function CELL, with the "filename" argument:
=CELL("filename")
This returns the full path. In case you just want the name you may need
to
use some text functions. In the case I tried, with Excel 2003, the file
name
was enclosed in braquets, so this formula gave just the bare name:
=MID(CELL("filename"),FIND("[",CELL("filename"),1)+1,FIND("]",CELL("filename"),1)-FIND("[",CELL("filename"),1)-1)

Hope this helps,
Miguel.

"Doug" wrote:

Would like to have a cell value the the name of the excell file I am
creating.
Similar to inserting the file name into the header or footer.