Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excell -Import

Status
Not open for further replies.

Vehcom

Technical User
Jan 19, 2005
1
0
0
CA
Can somebody give me a solution for te following:
I have an open worksheet in Excell, I'd like to read the list of the files from some filedirectorium and to write it down in Excell worksheet in column A. (perhaps few hundreds of file names).
How can I do that?
 
You can start by posting what you have tried already

You are unlikely to get someone writing all your code for you as the ethos of these fora is to teach people to fish rather than giving them a fish.

Rgds, Geoff

"Three things are certain: Death, taxes and lost data. Guess which has occurred"

Please read FAQ222-2244 before you ask a question
 
Geoff

I did not mean to ask anybody to write me some loooong codes. If you remember in DOS, it was very easy to list a file directorium and put it in file just writing
DIR C:\ >FILENAME, and you had a list of all files from C:\ directorium in ASCI file named FILENAME .
My thought was perphaps I can import that kind of file in Excell and read it. Unfortunatelly under DOS you can just have max 8 letter filename.
Geoff, I really did not want to get any fish from anybody, just a good suggestion, what I thought in this case is easier.
That's why is this Forum here.
I would add 4th things are certain: If you dont ask nobody will answer to you.
 
In which case, please pardon my initial statement

To do what you require would need some VBA I think - wouldn't be that complex but it kinda depends if you want to use code or not...

Rgds, Geoff

"Three things are certain: Death, taxes and lost data. Guess which has occurred"

Please read FAQ222-2244 before you ask a question
 
Copy and paste the code below to notepad and save as filename.cmd on your desk top. Then drag and drop any file from the folder you want to list and a .txt file will open showing the contents of the folder. You can then copy and paste to Excel and then use the columns-to-text option to seperate the file names and dates.


@echo off
if EXIST %1 goto start
echo ...Just drag and drop any file onto this program icon to grab its parent directory listing, then you can print the folder contents.
pause
goto end
:start
echo "%~dp1"
dir "%~dp1" > dir.txt || pause
start dir.txt
:end
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top