Listing file names from a folder into Excel

J

jeff

Hi,

Try this macro.

jeff
---------------

Sub files()
x = Dir("C:\MyFolder\*.*")
RowIndex = RowIndex + 1
Range(Cells(RowIndex, 1), Cells(RowIndex, 1)).Value = x
While x <> ""
RowIndex = RowIndex + 1
x = Dir
Range(Cells(RowIndex, 1), Cells(RowIndex, 1)).Value =
x
Wend
End Sub

-----Original Message-----
I am trying to list the file names of all the files in a
particular folder into Excel. I know about the formula
that will put the current file name into the cell, but I
would like to list all the files in a particular folder.
 
Top