Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default How to retrieve the name of the excel file into spreadsheet?

Does anyone have any suggestions on how to retrieve the filename of excel
into spreadsheet? for example
The name of working excel file is "Eric - RRRRR.xls", I would like to
retrieve the filename into cell A1, and to count the number of R within
"RRRRR", but ignore the part of the string "Eric - ". It should return 5 in
cell B1.
Does anyone have any suggestions on how to count it?
Thanks in advance for any suggestions
Eric
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default How to retrieve the name of the excel file into spreadsheet?

File path, file and worksheet name:
=CELL("filename",A1)
File path only:
=LEFT(CELL("filename",A1),FIND("[",CELL("filename",A1),1)-1)
File name only:
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1),1)+1,FIND("]",CELL("filename",A1),1)-FIND("[",CELL("filename",A1),1)-1)
The sheet name:
=MID(CELL("Filename",A1),FIND("]",CELL("Filename",A1))+1,255)
Restrictions
This technique only works for workbooks that have been saved, at least once.

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email


"Eric" wrote in message
...
Does anyone have any suggestions on how to retrieve the filename of excel
into spreadsheet? for example
The name of working excel file is "Eric - RRRRR.xls", I would like to
retrieve the filename into cell A1, and to count the number of R within
"RRRRR", but ignore the part of the string "Eric - ". It should return 5
in
cell B1.
Does anyone have any suggestions on how to count it?
Thanks in advance for any suggestions
Eric



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default How to retrieve the name of the excel file into spreadsheet?

Thank you very much for your suggestions
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1),1)+1,FIND("]",CELL("filename",A1),1)-FIND("[",CELL("filename",A1),1)-1), which will return
"Eric - RRRRR.xls"
Do you have any suggestions on how to remove "Eric - " & ".xls" and count
the number of "R" within the string "RRRRR"? and return 5 in cell B1
Thank you for any suggestions
Eric

"Bernard Liengme" wrote:

File path, file and worksheet name:
=CELL("filename",A1)
File path only:
=LEFT(CELL("filename",A1),FIND("[",CELL("filename",A1),1)-1)
File name only:
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1),1)+1,FIND("]",CELL("filename",A1),1)-FIND("[",CELL("filename",A1),1)-1)
The sheet name:
=MID(CELL("Filename",A1),FIND("]",CELL("Filename",A1))+1,255)
Restrictions
This technique only works for workbooks that have been saved, at least once.

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email


"Eric" wrote in message
...
Does anyone have any suggestions on how to retrieve the filename of excel
into spreadsheet? for example
The name of working excel file is "Eric - RRRRR.xls", I would like to
retrieve the filename into cell A1, and to count the number of R within
"RRRRR", but ignore the part of the string "Eric - ". It should return 5
in
cell B1.
Does anyone have any suggestions on how to count it?
Thanks in advance for any suggestions
Eric




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default How to retrieve the name of the excel file into spreadsheet?

With your formula in A1, this =MID(A1,8,256) will return RRRRR.XLS
So will =MID(your_formula,8,256)
And with the RRRRR.XSL in B1, this returns 5 (number of R's) =LEN(B1)-4

This returns just the R's: =LEFT(MID(A1,8,256),FIND(".",A1)-8)
This tells how many R's: =LEN(LEFT(MID(A1,8,256),FIND(".",A1)-8))
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"Eric" wrote in message
...
Thank you very much for your suggestions
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1),1)+1,FIND("]",CELL("filename",A1),1)-FIND("[",CELL("filename",A1),1)-1),
which will return
"Eric - RRRRR.xls"
Do you have any suggestions on how to remove "Eric - " & ".xls" and count
the number of "R" within the string "RRRRR"? and return 5 in cell B1
Thank you for any suggestions
Eric

"Bernard Liengme" wrote:

File path, file and worksheet name:
=CELL("filename",A1)
File path only:
=LEFT(CELL("filename",A1),FIND("[",CELL("filename",A1),1)-1)
File name only:
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1),1)+1,FIND("]",CELL("filename",A1),1)-FIND("[",CELL("filename",A1),1)-1)
The sheet name:
=MID(CELL("Filename",A1),FIND("]",CELL("Filename",A1))+1,255)
Restrictions
This technique only works for workbooks that have been saved, at least
once.

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email


"Eric" wrote in message
...
Does anyone have any suggestions on how to retrieve the filename of
excel
into spreadsheet? for example
The name of working excel file is "Eric - RRRRR.xls", I would like to
retrieve the filename into cell A1, and to count the number of R within
"RRRRR", but ignore the part of the string "Eric - ". It should return
5
in
cell B1.
Does anyone have any suggestions on how to count it?
Thanks in advance for any suggestions
Eric






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
Retrieve the date of another excel file BRABUS[_2_] Excel Discussion (Misc queries) 2 May 10th 07 03:14 PM
how do i retrieve overwritten Excel file Vaida Excel Worksheet Functions 1 April 21st 06 08:51 PM
How do i retrieve a deleted excel file????? Julie Semer Excel Discussion (Misc queries) 6 May 14th 05 06:10 PM
how to retrieve a deleted file in excel cgg Excel Discussion (Misc queries) 2 April 6th 05 05:58 PM
How do I retrieve a deleted file of Excel [email protected] Excel Worksheet Functions 1 January 28th 05 04:28 PM


All times are GMT +1. The time now is 09:53 PM.

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"