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
 
Top