Link to home
Start Free TrialLog in
Avatar of PercivalM
PercivalMFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Coping File names into Excel

Dear All,
Can you help i have a user that wants to copy pdf file names into excel and sort them in order of the file names that way can anyone help on how to do this excel
Many thanks
Avatar of ovi_mihai
ovi_mihai
Flag of Romania image

the simplest way is using Command Prompt

1 Go to your folder -> press Shift key and Right Click -> choose  "Open Command Window Here"

2 don't be scared of the black window... just type     dir    and press enter    (you can try better:  dir /b   command)

3 you will get the list of the files in that Folder.   Right Click and choose Mark then select the area with the names, it will turn white.. and then you press Enter

4 You can paste that list in excel  And this is it.


Expected problems depending on your system..

1 In the Shift+Right Click the "Open in Command Window" doesn't apear.
   - you will have to go to: Start -> Run -> type:  cmd     and press Enter
   - go to your folder with ex:   D:  then Enter  then use >  cd command
                 like  cd folder   than press Enter
         Example:       d:  <Enter>    cd myfolder  <enter>  cd mysubfolder
 - then type     dir

2. The selection in the cmd window includes the rows from the begining  try: dir /b


There is another way with VB script - which can read a folder directly and is more interactive
Press Alt+F11 and double click a sheet name - then you paste the code
Try http://vbaexpress.com/kb/getarticle.php?kb_id=837

You can download the example there at the bottom
ovi_mihai's VBA tool does not work on Excel 2010.

Anyway, another free tool you can use is Directory Lister::
http://www.portablefreeware.com/index.php?id=1157#comments

It can generate a text file for a list of files in selected folders.

:: Then maybe you can just copy the results into Excel.
ASKER CERTIFIED SOLUTION
Avatar of DrDamnit
DrDamnit
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial