file name

P

Peo Sjoblom

One way

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


--
Regards,

Peo Sjoblom

(No private emails please, for everyone's
benefit keep the discussion in the newsgroup/forum)
 
B

Bob Greenblatt

Is there a way to automatically place the name of the file
into a workbook cell?

An easier way than Peo's is to define a name containing a formula. This way
you don't have to parse the result to find the file name. Go to
Insert-Name-Define, and invent a name like "FileName" for example. In the
refers to box, enter "=get.document(1)" without the quotes, of course. Then
in the cell where you want the file name simply enter "=filename".

This will return the name of the file, followed by the sheet name. If you
want only the file name, change the 1 to an 88.
 
J

JE McGimpsey

Bob Greenblatt said:
An easier way than Peo's is to define a name containing a formula.

A potential drawback to this method is that if you try to copy a cell
using an XL4M command to another sheet, XL will crash.
 

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