Sub ListFilesIfNotOld()
Dim pStr As String, myFile As String, newSht As Worksheet, nR As Long
'Enter your folder path in next line
pStr = "Folder path goes between these quote marks" & Application.PathSeparator
myFile = Dir(pStr & "*.xls*")
If myFile = vbNullString Then Exit Sub
Application.ScreenUpdating = False
Set newSht = Sheets.Add(before:=Sheets(1))
With ActiveSheet
.Name = "FileList"
.Range("A1").Value = "Files"
If Not LCase(Left(myFile, 3)) = "old" Then
.Range("A2").Value = myFile
nR = .Range("a" & Rows.Count).End(xlUp).Row + 1
End If
End With
Do Until myFile = vbNullString
myFile = Dir()
If Not LCase(Left(myFile, 3)) = "old" Then
newSht.Range("A" & nR).Value = myFile
nR = newSht.Range("a" & Rows.Count).End(xlUp).Row + 1
End If
Loop
newSht.Columns("A").AutoFit
Application.ScreenUpdating = True
End Sub