best way to get ss current directory and filename?

S

Scott

Hello, whats the most effective way to get the current spreadsheet's
directory and filename??
 
N

Norman Harker

Hi Scott!

Try:
=LEFT(CELL("filename",A1),FIND("]",CELL("filename",A1))-1)

=CELL("filename",A1)

Returns full path including sheet name.
--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
P

Peo Sjoblom

For filename


=LEFT(MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,255),FIND(".",
MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,255))+3)

will work unless there is a really funky name
for directory/folder name


=RIGHT(LEFT(CELL("filename",A1),FIND("[",CELL("filename",A1))-2),LEN(LEFT(CE
LL("filename",A1),FIND("[",CELL("filename",A1))-2))-SEARCH("^^",SUBSTITUTE(L
EFT(CELL("filename",A1),FIND("[",CELL("filename",A1))-2),"\","^^",LEN(LEFT(C
ELL("filename",A1),FIND("[",CELL("filename",A1))-2))-LEN(SUBSTITUTE(LEFT(CEL
L("filename",A1),FIND("[",CELL("filename",A1))-2),"\","")))))

--

Regards,

Peo Sjoblom


Norman Harker said:
Hi Scott!

Try:
=LEFT(CELL("filename",A1),FIND("]",CELL("filename",A1))-1)

=CELL("filename",A1)

Returns full path including sheet name.
--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
Scott said:
Hello, whats the most effective way to get the current spreadsheet's
directory and filename??
 

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