View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ibeetb ibeetb is offline
external usenet poster
 
Posts: 67
Default Iterate through files in a folder on Hard Drive

How do I iterate through file names in a folder on a hardrive? I already
have the code to set the Path and give me the name of ONE of the files....b
ut I can't seem to loop through to all files in the folder:
'This code just keeps repeating the same file name in the folder yet there
are 20 files in the folder. I need it to scroll through all 20
directory = "T:\Completed Models\"
f = Dir(directory & "*.xls", 7)
Do While f<""
Result = directory & f
Loop