Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert file name into sheet
Hi There, I want to have the file name appear in cell a5, on a sheet (say called "test"). It needs to be able to update when users changes file name.. Any ideas.... Thanks D *** Sent via Developersdex http://www.developersdex.com *** |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert file name into sheet
=CELL("flename")
HTH -- AP "Darin Kramer" a écrit dans le message de ... Hi There, I want to have the file name appear in cell a5, on a sheet (say called "test"). It needs to be able to update when users changes file name.. Any ideas.... Thanks D *** Sent via Developersdex http://www.developersdex.com *** |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert file name into sheet
Thanks - but that inserts path as well as filename - is it possible just
to get file name? Regards D *** Sent via Developersdex http://www.developersdex.com *** |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert file name into sheet
Assuming your =CELL formula is in A1
Enter the following in B1: =MID(A1,SEARCH("[",A1)+1,SEARCH("]",A1)-SEARCH("[",A1)-1) HTH -- AP "Darin Kramer" a écrit dans le message de ... Thanks - but that inserts path as well as filename - is it possible just to get file name? Regards D *** Sent via Developersdex http://www.developersdex.com *** |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert file name into sheet
=CELL("filename")
You need to include a cell reference in the call to CELL. E.g., =CELL("filename",A1) Otherwise, the function will return the name of the workbook that is active when the formula is calculated, which may not be the same workbook that contains the formula. The cell reference (it can be any cell -- it doesn't matter) ensures that the correct workbook name is returned. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Ardus Petus" wrote in message ... =CELL("flename") HTH -- AP "Darin Kramer" a écrit dans le message de ... Hi There, I want to have the file name appear in cell a5, on a sheet (say called "test"). It needs to be able to update when users changes file name.. Any ideas.... Thanks D *** Sent via Developersdex http://www.developersdex.com *** |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert file name into sheet
In agreement with Chip's recommendation, and to facilitate using only one
cell, you could enter Ardus's formula like this: =MID(CELL("filename",A1),SEARCH("[",CELL("filename",A1))+1,SEARCH("]",CELL("filename",A1))-SEARCH("[",CELL("filename",A1))-1) Regards, GS |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I insert template in new sheet of pre-existing excel file? | Excel Worksheet Functions | |||
when i insert word art in excel sheet excel file closes automatica | Excel Discussion (Misc queries) | |||
Inserting a row in sheet A should Insert a row in sheet B, removing a row in Sheet A should remove the corresponding row in sheet B | Excel Programming | |||
How do I insert/update VBA code into a sheet? (using a CLS file?) | Excel Programming | |||
Macro to insert values from a file and save another sheet as a .txt file | Excel Programming |