By using t2do.com you agree to our cookie policy, We and our partners operate globally and use cookies, for multiple purposes

Get Files in a Directory

The below code will
sFile = "c:\some\Directory\"
sFile = dir(sFile)
do while sFile <> ""
    'Do something
     i = i + 1
     cells(i,1) = sFile ' loads file names into column 1

    sFile = Dir()
Loop