The following code pulls in all folders within a particular folder path.
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("LOCATION")
With Worksheets("Sheet1")
i = 1
For Each objSubFolder In objFolder.subfolders
Cells(i + 1, 4) = objSubFolder.Name
i = i + 1
Next objSubFolder
I'm trying to modify this script to only pull in folders which were populated in this path within the last week but i'm unsure how to achieve this. Thank you in advance.
To get the date created, you can use the below line in your code. But I am not sure how to get last week's data alone.
Cells(i + 1, 5) = objSubFolder.DateCreated
If you get the dates, may be you can do a filter for last week's date.