Copy file names

  • Thread starter Thread starter americana
  • Start date Start date
This little macro will list all the files in the folder that holds the
file that has this macro in it. Change the folder as necessary. HTH Otto
Sub GetFileList()
Dim ThePath As String
ThePath = ThisWorkbook.Path
fname = Dir(ThePath & "\*.xls")
i = 1
Do While fname <> ""
Range("A" & i) = fname
fname = Dir()
i = i + 1
Loop
End Sub
 
Back
Top