Help end medical misogyny. Sign our petition.

Help end medical misogyny.
Sign our petition.

Sign the petition

Please or to access all these features

Geeky stuff

Excel question - putting the filename into a cell

2 replies

mankymummymoo · 12/11/2009 09:54

Hi, todays idiots question...

I have an excel file called eg. Invoice01.xls. I will be creating a whole sequence of invoices (invoice02.xls, invoice03.xls etc) and want the invoice numbers that are on the actual worksheet, to be created automatically (so I dont muck them up).

One way I thought of doing it was referencing the filename of the excel document (so as long as I have the filenames correct and in sequence the invoice numbers will be too)... Is this possible?

In english I want to basically have a cell with text=filename or something like that...

Thank you.

OP posts:
BadgersPaws · 12/11/2009 10:21

How does this do you....

This will give you the full path, file and worksheet name:
=CELL("filename")

This should give you just the filename:
=MID(CELL("filename"),SEARCH("[",CELL("filename"))+1, SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))-1)

mankymummymoo · 12/11/2009 10:50

Works perfectly.

You are my Excel Hero - thanks so much for your help the last couple of days...

OP posts:
New posts on this thread. Refresh page