title: Print file names in folder to Excel Sheet in order of file creation date
body: <p>Hi there I have a procedure that prints file names found in a folder to an excel sheet, but I wonder if it could be modified so that it sorts the files in the folder by file <code>Date Modified</code> (like in the explorer) first and then prints the file names in that order to the sheet. Any help would be appreciated! </p>
  
  <pre><code>Sub HGDW_PrintFiles()
      Dim objFSO As Object
      Dim objFolder As Object
      Dim objFile As Object
      Dim i As Integer
  
      'Create an object of the FileSystemObject
      Set objFSO = CreateObject("Scripting.FileSystemObject")
  
      'Get the folder object
      Set objFolder = objFSO.Getfolder("C:\Users\bf91955\Desktop\Test\")
      i = 1
  
      'loops through each file in the directory and prints their names and path
      For Each objFile In objFolder.Files
          'print file name to column a
          Cells(i, 1) = objFile.Name
          i = i + 1
      Next objFile
  End Sub
  </code></pre>