ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Linking cell to filename (https://www.excelbanter.com/excel-worksheet-functions/265971-linking-cell-filename.html)

littlecheets

Linking cell to filename
 
Hello there,

I found the following to put the worksheet filename in a cell.

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

This works just fine. However, I was wondering if there's any way to hide the file extension? I need the extension viewable in my folders, so I have it turned on. But I don't need it to appear in my worksheet.

Any help would be appreciated!

-Ky

Sepeteus Jedermann

Quote:

Originally Posted by littlecheets (Post 959542)
Hello there,

I found the following to put the worksheet filename in a cell.

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

This works just fine. However, I was wondering if there's any way to hide the file extension? I need the extension viewable in my folders, so I have it turned on. But I don't need it to appear in my worksheet.

Any help would be appreciated!

-Ky

Hi,

try this version of worksheet formula :

=LEFT(TEXT(CELL("filename") ; ) ; MID(".";TEXT(CELL("filename") ; ) ; 1)-1)&RIGHT(TEXT(CELL("filename") ; ) ; LEN(TEXT(CELL("filename") ; ) )-MID(".";TEXT(CELL("filename") ; ) ; 1 )-3)

This locates dot from filename and then takes left part and right part from
filename - string leaving dot and 3 next characters away.

I was forced to add some extra spaces to above formula, because they
was counted as smileys at this page . . . and I can't correct or
citate those.

***


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

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