PDA

View Full Version : Problem about Loop through files sort by Date.



thanhvanchi
12-05-2016, 08:10 PM
Hello everyone!

first off thanks for any help.


im using the below code to loop through files but it automatically loops through the files alphabetically, is it possible to modify such that the loop is sorted by Date modified (earliest first)?


thanks



MyFile = Dir(MyPath)Do While MyFile <> ""
'do stuffs
MyFile = Dir
Loop


Formatting tags added by mark007

snb
12-06-2016, 02:37 AM
sn=split(createobject("wscript.shell").exec("cmd /c dir ""G:\OF\*.*"" /b/s/od").stdout.readall,vbcrlf)