Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to extract file name for use in a cell?
Hi, Using XL2002 and Windows 2000
If I have a file named A00015249CR.csv and I want to place the first 11 characters of the filename in a cell, how would I do that, if it's possible. What I need to do is run several scripts on files that return simialr data, so inserting the filename into an inserted column at the left of each dataset would allow me to combine the data into one file and still know where each row of data originated. Thanks in advance! Norm |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to extract file name for use in a cell?
Use the cell function
=cell("filename",A1) where A1 is any cell in the workbook associated with the name yu are looking for. " wrote: Hi, Using XL2002 and Windows 2000 If I have a file named A00015249CR.csv and I want to place the first 11 characters of the filename in a cell, how would I do that, if it's possible. What I need to do is run several scripts on files that return simialr data, so inserting the filename into an inserted column at the left of each dataset would allow me to combine the data into one file and still know where each row of data originated. Thanks in advance! Norm |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to extract file name for use in a cell?
if you are doing it with code
Set bk = Activeworkbook s = left(bk.Name,Instr(1,bk.name,".",vbTextcompare)-1) -- Regards, Tom Ogilvy " wrote: Hi, Using XL2002 and Windows 2000 If I have a file named A00015249CR.csv and I want to place the first 11 characters of the filename in a cell, how would I do that, if it's possible. What I need to do is run several scripts on files that return simialr data, so inserting the filename into an inserted column at the left of each dataset would allow me to combine the data into one file and still know where each row of data originated. Thanks in advance! Norm |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Extract file name | Excel Worksheet Functions | |||
How to extract file extensions? | Excel Programming | |||
Extract from a file | Excel Discussion (Misc queries) | |||
How to extract value from a different file? | Excel Worksheet Functions | |||
Function required to extract cell info from an unopened file. | Excel Worksheet Functions |