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??