best way to get ss current directory and filename?

  • Thread starter Thread starter Scott
  • Start date Start date
S

Scott

Hello, whats the most effective way to get the current spreadsheet's
directory and filename??
 
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.
 
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??
 
Back
Top