Getting a list of file names from Windows Explorer into Excel

  • Thread starter Thread starter Steve M
  • Start date Start date
S

Steve M

Howdy,

On my hard drive, I have a 30 or so folders with a total
of 3500+ graphic images in them. I need to list them all
in a column in excel.

Can anyone help me or explain to me how I copy just the
file names (not the actual image) and import them into
the spreadsheet.

Thank you very much if you can help me.

I have been stuck on this for a few days. I don't know
excel that well.

STeve
 
www.moonsoftware.com

Go there and DL FileTargets. It's a program that once installed lets you copy
the file path including the file names to clipboard. Then you may paste
anywhere, including Excel. Thru Excel you can use many options to crop off
what you dont want. It's a handy tool and have used it for what your're
looking to do.

Dennis
===========
 
Steve M said:
Howdy,

On my hard drive, I have a 30 or so folders with a total
of 3500+ graphic images in them. I need to list them all
in a column in excel.

Can anyone help me or explain to me how I copy just the
file names (not the actual image) and import them into
the spreadsheet.

Thank you very much if you can help me.

I have been stuck on this for a few days. I don't know
excel that well.

STeve

Try this in a module (change the path to suit):

Sub IndexFiles()

' To use, select an empty worksheet - it will drop the file names
(including path) into column A
' When it completes, you should have a full path listing of all files
' and folders in the named directory

With Application.FileSearch

.LookIn = "C:\MyMusic"
.FileType = msoFileTypeAllFiles
.SearchSubFolders = True
.Execute

End With

cnt = Application.FileSearch.FoundFiles.Count

For i = 1 To cnt

rng = "A" & i

Range(rng).Value = Application.FileSearch.FoundFiles.Item(i)

Next i

End Sub
 
Dennis, Thank you so much, I can kiss you and hug you,
and what ever happens. It worked. Come to find out I
had over 10,000 images to do that with.

As far as Alan's way of doing it. Ha, I don't know what
the hell he told me to do. He must be one of those,
college grads. hahahah

Thanks again both of you.

Steve
 
Back
Top