ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Display filename in cell (https://www.excelbanter.com/excel-discussion-misc-queries/109724-display-filename-cell.html)

Jeff

Display filename in cell
 
Hi,

I was using the ' =Cell("Filename") ' function in excel,

But I want to display only the path "= C:\Folder1\Folder2\"
And then I want to display the worksheet name = "worksheet1"

Is there a way to do this?

THanks

Allllen

Display filename in cell
 
Path is
=LEFT(CELL("filename",A1),FIND("[",CELL("filename",A1),1)-1)

Sheet name is
=MID(CELL("Filename",A1),FIND("]",CELL("Filename",A1))+1,255)

more here
http://www.xldynamic.com/source/xld.xlFAQ0002.html

--
Allllen


"Jeff" wrote:

Hi,

I was using the ' =Cell("Filename") ' function in excel,

But I want to display only the path "= C:\Folder1\Folder2\"
And then I want to display the worksheet name = "worksheet1"

Is there a way to do this?

THanks


Dave Peterson

Display filename in cell
 
This will return the worksheet name:
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)

and this will return the folder:
=MID(CELL("filename",A1),1,FIND("[",CELL("filename",A1))-1)



Jeff wrote:

Hi,

I was using the ' =Cell("Filename") ' function in excel,

But I want to display only the path "= C:\Folder1\Folder2\"
And then I want to display the worksheet name = "worksheet1"

Is there a way to do this?

THanks


--

Dave Peterson


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com