I'm using the following to list in a spread sheet all the files in select folders. I know want to list the date next to that and am trying to use .lastmodified, but I cannot seem to write it correclty. Can anyone help?
Code:
f1 = CC & f & ""
With Application.FileSearch
.NewSearch
.LookIn = f1
.FileName = "*.*"
.SearchSubFolders = False
.Execute
For i = 1 To .FoundFiles.Count
ActiveCell.Offset(r - 1, 0).Value = .FoundFiles(i)
ActiveCell.Offset(r - 1, 1).Value = .FoundFiles(i).LastModified
'r1 = r1 + r1
r = r + 1
Next i
End With
Code:
f1 = CC & f & ""
With Application.FileSearch
.NewSearch
.LookIn = f1
.FileName = "*.*"
.SearchSubFolders = False
.Execute
For i = 1 To .FoundFiles.Count
ActiveCell.Offset(r - 1, 0).Value = .FoundFiles(i)
ActiveCell.Offset(r - 1, 1).Value = .FoundFiles(i).LastModified
'r1 = r1 + r1
r = r + 1
Next i
End With