View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Doug Glancy Doug Glancy is offline
external usenet poster
 
Posts: 770
Default Having file name on the excel sheet automatically

Afshin,

The formulas at Chip Pearon's page that Tom suggested will do just what you
want, e.g.,

To return the file name without the path, use
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND("]",
CELL("filename",A1))-FIND("[",CELL("filename",A1))-1)

hth,

Doug Glancy

"A-DESIGN" wrote in message
...
Thanks for all replies but I need the file name to be written in one cell
inside the sheet and not to be as a name for the worksheet, also I need it
to be updated automatically when I do save as or rename the file.

Thanks
Afshin



"Tom Ogilvy" wrote in message
...
See the formulas at the bottom of Chip Pearson's page:

http://www.cpearson.com/excel/excelF.htm

these formulas require that the workbook have been saved at least once
before they will word - so putting them in the default Book1 would not
work
(until it had been saved).

--
Regards,
Tom Ogilvy


"A-DESIGN" wrote in message
...
Hi,

I need to have the file name in the excel sheet,can anyone give me some
instruction or codes that can do this.

Thanks,