Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
jcb jcb is offline
external usenet poster
 
Posts: 8
Default i want to insert the file name in a cell, how do I do this


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default i want to insert the file name in a cell, how do I do this

Try this:

=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND("]",CELL("filename",A1))-FIND("[",CELL("filename",A1))-5)

Enter the formula in any cell on any sheet. The file must have been saved at
least once for it to work.

Do not change anything in the formula.

--
Biff
Microsoft Excel MVP


"JCB" wrote in message
...



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,346
Default i want to insert the file name in a cell, how do I do this

Hi,

Sorry to piggy back on your answer, but since to OP didn't include anything
in the body of the post I can't reply using the web interface.

=MID(CELL("filename"),FIND("[",CELL("filename"))+1,FIND("]",CELL("filename"))-FIND("[",CELL("filename"))-1)

This is a great time to create a range name, say F which is
=CELL("filename"), then the formula would be

=MID(F,FIND("[",F)+1,FIND("]",F)-FIND("[",F)-1)

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"T. Valko" wrote:

Try this:

=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND("]",CELL("filename",A1))-FIND("[",CELL("filename",A1))-5)

Enter the formula in any cell on any sheet. The file must have been saved at
least once for it to work.

Do not change anything in the formula.

--
Biff
Microsoft Excel MVP


"JCB" wrote in message
...




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default i want to insert the file name in a cell, how do I do this

Without the reference to a cell in the worksheet/workbook, then this formula:

=CELL("filename")

will return info about the workbook that is active when excel recalculates.

Adding a reference to a cell in the workbook/worksheet with the formula will
make this problem go away:

=CELL("filename",A1)

(I like to use the cell that contains the formula)

Shane Devenshire wrote:

Hi,

Sorry to piggy back on your answer, but since to OP didn't include anything
in the body of the post I can't reply using the web interface.

=MID(CELL("filename"),FIND("[",CELL("filename"))+1,FIND("]",CELL("filename"))-FIND("[",CELL("filename"))-1)

This is a great time to create a range name, say F which is
=CELL("filename"), then the formula would be

=MID(F,FIND("[",F)+1,FIND("]",F)-FIND("[",F)-1)

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire

"T. Valko" wrote:

Try this:

=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND("]",CELL("filename",A1))-FIND("[",CELL("filename",A1))-5)

Enter the formula in any cell on any sheet. The file must have been saved at
least once for it to work.

Do not change anything in the formula.

--
Biff
Microsoft Excel MVP


"JCB" wrote in message
...





--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default i want to insert the file name in a cell, how do I do this

Sorry to piggy back on your answer

Biting my tongue

--
Biff
Microsoft Excel MVP


"Shane Devenshire" wrote in
message ...
Hi,

Sorry to piggy back on your answer, but since to OP didn't include
anything
in the body of the post I can't reply using the web interface.

=MID(CELL("filename"),FIND("[",CELL("filename"))+1,FIND("]",CELL("filename"))-FIND("[",CELL("filename"))-1)

This is a great time to create a range name, say F which is
=CELL("filename"), then the formula would be

=MID(F,FIND("[",F)+1,FIND("]",F)-FIND("[",F)-1)

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"T. Valko" wrote:

Try this:

=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND("]",CELL("filename",A1))-FIND("[",CELL("filename",A1))-5)

Enter the formula in any cell on any sheet. The file must have been saved
at
least once for it to work.

Do not change anything in the formula.

--
Biff
Microsoft Excel MVP


"JCB" wrote in message
...






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert file name in cell without .xls extension Steve Excel Discussion (Misc queries) 8 April 3rd 23 04:25 PM
how do I insert a sequential number to a cell each time the file i Steven Jones[_2_] New Users to Excel 2 July 20th 08 12:26 PM
How can I insert the author name held in File/Properties in a cell Lubka Excel Discussion (Misc queries) 1 April 17th 07 02:37 PM
I want to insert the file properties into a cell for printing. Felicity Excel Discussion (Misc queries) 1 February 5th 07 04:59 PM
How do I insert in a cell a link to display a JPG file in window LJL Asia Setting up and Configuration of Excel 0 May 19th 05 03:47 AM


All times are GMT +1. The time now is 03:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"