Filename in Excel Cell Address

  • Thread starter Thread starter RickS
  • Start date Start date
R

RickS

Is there a way to insert an excel spreadsheet filename into a cell within the
same spreadsheet, like the &[File] command in the Header/Footer screen?
 
Hi,

For the Fullname including path

=CELL("filename")

for the file name only

=MID(CELL("filename"),SEARCH("[",CELL("filename"))+1,
SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))-1)

Note the workbook must be save for this to work
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 
Thanks for your help Mike,

I used the ful path name and it works fine, except it also added the
"Sheet1" at them end, any way not to have that?
--
Thanks,
RickS


Mike H said:
Hi,

For the Fullname including path

=CELL("filename")

for the file name only

=MID(CELL("filename"),SEARCH("[",CELL("filename"))+1,
SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))-1)

Note the workbook must be save for this to work
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


RickS said:
Is there a way to insert an excel spreadsheet filename into a cell within the
same spreadsheet, like the &[File] command in the Header/Footer screen?
 
thanks Mike,

I used the full file path approach and it is what I wanted, but it also
placed the "Sheet1" at the end, is there a way to suppress this?
 
thanks Gary,

is there a way to not get the "Sheet1" at the end of the path and filename?
--
Thanks,
RickS


Gary Keramidas said:
yes

=CELL("filename")

--


Gary Keramidas
Excel 2003


RickS said:
Is there a way to insert an excel spreadsheet filename into a cell within
the
same spreadsheet, like the &[File] command in the Header/Footer screen?

.
 
maybe this

=LEFT(CELL("filename"),FIND("[",CELL("filename"),1)-1)
--


Gary Keramidas
Excel 2003


RickS said:
thanks Gary,

is there a way to not get the "Sheet1" at the end of the path and
filename?
--
Thanks,
RickS


Gary Keramidas said:
yes

=CELL("filename")

--


Gary Keramidas
Excel 2003


RickS said:
Is there a way to insert an excel spreadsheet filename into a cell
within
the
same spreadsheet, like the &[File] command in the Header/Footer screen?

.
 
Back
Top