filename formula

C

Chris Hill

Is there a formula to enter the filename on the worksheet?

The filename can be shown on the page setup header/footer
section, but I need it to show on the worksheet itself.

Thanks
 
A

Akshay Bakhai

Try =cell("filename")

This will give you the entire path all the way to the
sheet name. To remove path details and sheet name details
you can use existing functions to manipulate text.

If the file is a "new file" and not yet saved, then it
will return a blank value.
 
J

Jan Karel Pieterse

Hi,

It is better to use the second argument, otherwise this
formula will return these details for the ACTIVE workbook
and sheet (and give unexpected results after a full recalc
while another workbook is active!!!):

=cell("filename",A1)


Regards,

Jan Karel Pieterse
Excel TA/MVP
 

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