List of Files in A Directory

J

JaneC

Hi,

I am wanting to get a list of files in a certain folder displayed as a list,
without me having to manually type them in (There'e about 150 files). It
doesn't necessarily need to be done in excel, but it would save me ALOT of
time if I could import the file names into a list.

Thanks, Jane
 
J

Jim Cone

Jane,

Check out the free Excel add-in "List Files" here...
http://www.realezsites.com/bus/primitivesoftware

Jim Cone
San Francisco, USA


"JaneC" <[email protected]>
wrote in message
Hi,
I am wanting to get a list of files in a certain folder displayed as a list,
without me having to manually type them in (There'e about 150 files). It
doesn't necessarily need to be done in excel, but it would save me ALOT of
time if I could import the file names into a list.

Thanks, Jane
 
V

vezerid

Jane,
the following macro will list the contents of folder in column A:A
starting from A1. Modify to suit:

Sub ListFiles()
mypath = "D:\Excel Notes\*.*" 'Modify to suit
i = 0 'Set i to row-1 of the starting row of the data.
myfile = Dir(mypath, vbNormal)
While myfile <> ""
i = i + 1
Cells(i, 1) = myfile 'Modify 1 here to the column you want the
list
myfile = Dir
Wend
End Sub

HTH
Kostis Vezerides
 
Top