Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Ian Elliott
 
Posts: n/a
Default how get filename with worksheet function?

Thanks for any help.
I would like to get the filename with a worksheet function, is this possible?
I tried help "filename" and "file" but nothing of relation. What is a good
way to search for these things on the help file?
Thanks.
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default how get filename with worksheet function?

See Debra Dalgleish's site:
http://contextures.com/xlfaqFun.html#SheetName

I think I'd search google groups first. Then I'd learn enough to know what to
look for in excel's help.



Ian Elliott wrote:

Thanks for any help.
I would like to get the filename with a worksheet function, is this possible?
I tried help "filename" and "file" but nothing of relation. What is a good
way to search for these things on the help file?
Thanks.


--

Dave Peterson
  #3   Report Post  
Arvi Laanemets
 
Posts: n/a
Default how get filename with worksheet function?

Hi

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

The formula may be in any cell.
Instead A1 you can refer to any cell - am best you refer to same cell the
formula resides in.
NB! The workbook MUST be saved - in freschly created unsave workbook it
doesn't work!


Arvi Laanemets



"Ian Elliott" wrote in message
...
Thanks for any help.
I would like to get the filename with a worksheet function, is this

possible?
I tried help "filename" and "file" but nothing of relation. What is a good
way to search for these things on the help file?
Thanks.



  #4   Report Post  
JMB
 
Posts: n/a
Default how get filename with worksheet function?

Try

=Cell("Filename")

I think Arvi meant:
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND("]",CELL("filename",A1))-FIND("[",CELL("filename",A1))-1)

"Ian Elliott" wrote:

Thanks for any help.
I would like to get the filename with a worksheet function, is this possible?
I tried help "filename" and "file" but nothing of relation. What is a good
way to search for these things on the help file?
Thanks.

  #5   Report Post  
Arvi Laanemets
 
Posts: n/a
Default how get filename with worksheet function?

Hi

Thanks for correction. I put CELL function into A1 at start, and created an
expression to get file name from there - and of course I completly forgot to
replace the reference to A1 with formula :-(


--
Arvi Laanemets
( My real mail address: arvil<attarkon.ee )



"JMB" wrote in message
...
Try

=Cell("Filename")

I think Arvi meant:
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND("]",CELL("filename",A1))-FIND("[",CELL("filename",A1))-1)

"Ian Elliott" wrote:

Thanks for any help.
I would like to get the filename with a worksheet function, is this
possible?
I tried help "filename" and "file" but nothing of relation. What is a
good
way to search for these things on the help file?
Thanks.





  #6   Report Post  
JMB
 
Posts: n/a
Default how get filename with worksheet function?

I had assumed as much.

"Arvi Laanemets" wrote:

Hi

Thanks for correction. I put CELL function into A1 at start, and created an
expression to get file name from there - and of course I completly forgot to
replace the reference to A1 with formula :-(


--
Arvi Laanemets
( My real mail address: arvil<attarkon.ee )



"JMB" wrote in message
...
Try

=Cell("Filename")

I think Arvi meant:
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND("]",CELL("filename",A1))-FIND("[",CELL("filename",A1))-1)

"Ian Elliott" wrote:

Thanks for any help.
I would like to get the filename with a worksheet function, is this
possible?
I tried help "filename" and "file" but nothing of relation. What is a
good
way to search for these things on the help file?
Thanks.




  #7   Report Post  
Harlan Grove
 
Posts: n/a
Default how get filename with worksheet function?

Ian Elliott wrote...
....
I would like to get the filename with a worksheet function, is this possible?
I tried help "filename" and "file" but nothing of relation. What is a good
way to search for these things on the help file?


First, online help. You could always try looking up the term filename
in the help index. Actually, there's no entry for 'filename', but you'd
see 'file name' in the 'Or choose keywords' section of the help dialog.
The first topic for 'file name' is the CELL worksheet functions (at
least in XL10 (XP/2002)).

That said, CELL("Filename",A1) only returns the pathname if the file
has been saved. If you had other worksheets, you could use some
trickery. If you wanted the filename in a cell in worksheet A and you
also had a worksheet B, try

=MID(CELL("Address",B!$A$1),FIND("[",CELL("Address",B!$A$1))+1,
FIND("]",CELL("Address",B!$A$1))-FIND("[",CELL("Address",B!$A$1))-1)

This CELL("Address",Range) returns the workbook and worksheet names
along with the cell address when Range is in a different worksheet from
the cell calling the CELL function in its formula, EVEN IF THE FILE
HASN'T BEEN SAVED.

So one has to wonder why CELL("Filename",Range) returns "" for unsaved
files.

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Barry Clark
 
Posts: n/a
Default how get filename with worksheet function?


This code
Code:
--------------------
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND("]",CELL("filename",A1))-FIND("[",CELL("filename",A1))-1)

--------------------
works almost perfect for my needs; however, I need it to drop the
extension to where only the name of the name of the file is left.

Any thoughts?

Thanks!


--
Barry Clark
------------------------------------------------------------------------
Barry Clark's Profile: http://www.excelforum.com/member.php...o&userid=35267
View this thread: http://www.excelforum.com/showthread...hreadid=479553

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default how get filename with worksheet function?

=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND(".",CELL("file
name",A1))-FIND("[",CELL("filename",A1))-1)

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Barry Clark"
wrote in message
...

This code
Code:
--------------------

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

--------------------
works almost perfect for my needs; however, I need it to drop the
extension to where only the name of the name of the file is left.

Any thoughts?

Thanks!


--
Barry Clark
------------------------------------------------------------------------
Barry Clark's Profile:

http://www.excelforum.com/member.php...o&userid=35267
View this thread: http://www.excelforum.com/showthread...hreadid=479553



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
Comparing a list to a Calendar worksheet. PatrickL Excel Worksheet Functions 0 August 25th 05 04:21 PM
changing font style in a complex worksheet function gvm Excel Worksheet Functions 6 August 3rd 05 01:29 AM
How do I use the TABLE worksheet function? Jo Excel Worksheet Functions 2 July 2nd 05 12:41 PM
Automatically up date time in a cell Mark Excel Discussion (Misc queries) 5 May 12th 05 12:26 AM
The Help on the Excel Edate worksheet function contains an error:. Guido Excel Worksheet Functions 1 January 20th 05 01:42 PM


All times are GMT +1. The time now is 04:53 AM.

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

About Us

"It's about Microsoft Excel"