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

I should specify, I know:

=CELL("filename") returns C:\Mydocuments\[ss.xls]Sheet

but want a SIMPLE formula to get:

C:\MyDocuments\ss.xls

and

ss.xls

without having to cut out parts of text etc etc

is there a simple way to do this?
 
D

David McRitchie

Don't use =CELL("filename") unless you know what you are
doing, as it will return information from your last calculation
as to which sheet you were on -- most of the time it will not
be the worksheet the formula is used in. Though you may
what you want to see when you are on the worksheet most
of the time. Try using that formula on two different sheets
then look at the first use then hit F9 then look at the second again.

You must use a reference so that you access the
worksheet you are in =CELL("filename",A1)
or a change A1 to reference another worksheet sheet1!A1
or another workbook. More information in
http://www.mvps.org/dmcritchie/excel/pathname.htm

along with examples of extracting the worksheet, pathname, etc.
 

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