Capture.PNG
Hello everyone,
I am new to this wonderful forum and equally new to VBA.
I have the following situation:
the main folder ( Projects) which contains a number of 5 subfolders ( named Projects 1, Projects 2 and so on) each of these subfolders has 4 more subfolders named the same (Vendors, Planning, Schedule, Team).
I'm interested in opening each individual Project (Projects 1, Projects 2 and so on) and opening only the folder named Schedule.
I want to tell me in a message or display in an excel table if any files were added in the last day. Something like this code:
Sub LookForNew()
Dim n As String, msg As String, d As Date
msg = ""
Set fso = CreateObject("Scripting.FileSystemObject")
Set fils = fso.GetFolder("C:\Users\ User\Desktop\New folder (3)").Files
For Each fil In fils
n = fil.Name
d = fil.DateCreated
If d >= Date - 1 Then
msg = msg & n & vbTab & d & vbCrLf
End If
Next fil
If msg = "" Then
MsgBox "No new files"
Else
MsgBox msg
End If
Set fso = Nothing
End Sub
The problem is that I don't know how to add this loop in this code to search each project folder.
Thank you so much!
Bookmarks