View Single Post
  #2   Report Post  
Don Guillett
 
Posts: n/a
Default

This macro will make a list of all files in "yourfolder". Change to suit. If
you only want excel files, uncomment the .filename line.

With Application.FileSearch
.NewSearch
.LookIn = "c:\YourFolder"
'.SearchSubFolders = True 'False
'.FileName = ".xls" 'Your file types
If .Execute 0 Then
For iCtr = 1 To .FoundFiles.Count
Cells(iCtr, 1).Value = .FoundFiles(iCtr)
Next iCtr
End If
End With


--
Don Guillett
SalesAid Software

"craigwojo" wrote in message
...

Hi everyone,

I need to take file names from directories on my hard dirve and import
the file name into a cell. I don't want to type all the file names
into each cell. Also if I add a file to the directory I would like it
to update the excel sheet and put the file in the correct place. If
the second part is hard to understand, forget about it, I really need
the first part of this question.

Thank you,
Craig


--
craigwojo
------------------------------------------------------------------------
craigwojo's Profile:

http://www.excelforum.com/member.php...o&userid=13767
View this thread: http://www.excelforum.com/showthread...hreadid=274415