Advanced search

Excel question - putting the filename into a cell

(3 Posts)
mankymummymoo Thu 12-Nov-09 09:54:20

Hi, todays idiots question... blush

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.

BadgersPaws Thu 12-Nov-09 10:21:43

How does this do you....

This will give you the full path, file and worksheet name:

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

mankymummymoo Thu 12-Nov-09 10:50:25

Works perfectly.

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

Join the discussion

Registering is free, easy, and means you can join in the discussion, watch threads, get discounts, win prizes and lots more.

Register now »

Already registered? Log in with: