View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Frank Pytel Frank Pytel is offline
external usenet poster
 
Posts: 103
Default Reading from a folder

Hello Gary;

This worked great. I was able to modify the code so that it would select all
files in a folder.

If you have time, how would I modify this code to get all of the files based
on the path that I would paste into cell A1? Is this possible?

Thanks for your help, Gary (and anyone else that would know of an answer to
this question.

Have a Great Day.

Frank Pytel

"Gary''s Student" wrote:

Change the folder path and filetype to suit:

Sub list_um()
Dim F As String
Dim roww As Long
roww = 0
Dim FileLocSpec As String
FileLocSpec = "C:\Temp\*.*"
F = Dir(FileLocSpec)
Do Until F = ""
roww = roww + 1
Cells(roww, 1).Value = F
F = Dir
Loop
End Sub
--
Gary''s Student - gsnu200802


"Alex" wrote:

Hi,

Is there any macro codes that I can use to read all the file names in a
particular folder or path and print the file names to an excel worksheet?