Thread: Copy file names
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Otto Moehrbach[_2_] Otto Moehrbach[_2_] is offline
external usenet poster
 
Posts: 1,071
Default Copy file names

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

"americana" wrote in message
...
How can I copy the file names, within a folder, to another excel
spreadsheet?