Solved

Coping File names into Excel

Posted on 2011-03-11
4
326 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:PercivalM
4 Comments
 
LVL 3

Expert Comment

by:ovi_mihai
ID: 35106591
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
0
 
LVL 1

Expert Comment

by:geff_chang
ID: 35107065
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.
0
 
LVL 32

Accepted Solution

by:
DrDamnit earned 500 total points
ID: 35187122
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question