hi
I need some help from professional to update this code
the code brings all of information from COL A : D but what I want split theses information based on month in column D
so what the code does currently is
and what I want
thanks in advance
I need some help from professional to update this code
VBA Code:
Sub GetFilesDetails()
' This macro will extract the list of the filenames from a folder as follows
' in column A= Files names
' in column B= Date Created
' in column C= Date Last Accessed
' in column D= Date Last Modified
Dim objFSO As Scripting.FileSystemObject
Dim myFolder As Scripting.Folder
Dim myFile As Scripting.File
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set myFolder = objFSO.GetFolder("C:\Users\PC CAP\Desktop\VV\")
Application.ScreenUpdating = False
''******************************************************************************
' these 2 code lines will clear the old data in Sheet? from columns A:D
' Row 1 is for the appropriate headers only
ThisWorkbook.Sheets("Sheet1").Range(Cells(2, 1), Cells(Rows.Count, 4)).ClearContents
R = 2
''********************************************************************
' Here we get the files details from folder and place them in the appropriate cells
For Each myFile In myFolder.Files
ThisWorkbook.Sheets("Sheet1").Cells(R, 1).Value = myFile.Name
ThisWorkbook.Sheets("Sheet1").Cells(R, 2).Value = myFile.DateCreated
ThisWorkbook.Sheets("Sheet1").Cells(R, 3).Value = myFile.DateLastAccessed
ThisWorkbook.Sheets("Sheet1").Cells(R, 4).Value = myFile.DateLastModified
R = R + 1
Next myFile
'''************Resizing the columns width****************
ThisWorkbook.Sheets("Sheet1").Columns("A:D").EntireColumn.AutoFit
Application.ScreenUpdating = True
'' Optional Alert
MsgBox "Updated"
End Sub
so what the code does currently is
1.xlsm | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | file name | file creation date | the last entry date | the last modified date | ||
2 | mm.xlsm | 06/29/2021 16:24 | 07/01/2021 11:51 | 06/29/2021 16:26 | ||
3 | mr excel.xlsx | 06/29/2021 16:05 | 07/01/2021 15:07 | 06/30/2021 16:26 | ||
4 | TR1.xlsx | 06/29/2021 16:15 | 07/01/2021 15:07 | 06/30/2021 16:26 | ||
5 | 1.pdf | 06/29/2021 16:15 | 07/01/2021 15:07 | 06/30/2021 16:26 | ||
6 | 2.pdf | 06/29/2021 16:15 | 07/01/2021 15:07 | 06/30/2021 16:26 | ||
7 | 3.pdf | 06/29/2021 16:15 | 07/01/2021 15:07 | 06/30/2021 16:26 | ||
8 | 4.pdf | 06/29/2021 16:23 | 07/01/2021 11:51 | 06/30/2021 16:26 | ||
9 | 5.pdf | 06/29/2021 16:24 | 07/01/2021 11:51 | 06/30/2021 16:26 | ||
10 | 6.pdf | 06/29/2021 16:25 | 07/01/2021 11:51 | 06/30/2021 16:26 | ||
11 | 7.pdf | 06/29/2021 16:26 | 07/01/2021 11:51 | 06/30/2021 16:26 | ||
12 | 8.pdf | 06/29/2021 16:27 | 07/01/2021 11:51 | 07/09/2021 16:26 | ||
13 | 9.pdf | 07/01/2021 16:24 | 07/01/2021 11:51 | 07/10/2021 16:26 | ||
14 | 10.pdf | 07/02/2021 16:25 | 07/01/2021 11:51 | 07/11/2021 16:26 | ||
15 | 11.pdf | 07/03/2021 16:26 | 07/01/2021 11:51 | 07/12/2021 16:26 | ||
16 | 12.pdf | 07/04/2021 16:27 | 07/01/2021 11:51 | 07/13/2021 16:26 | ||
17 | 13.pdf | 07/05/2021 16:28 | 07/01/2021 11:51 | 07/14/2021 16:26 | ||
18 | 14.pdf | 07/06/2021 16:29 | 07/01/2021 11:51 | 07/15/2021 16:26 | ||
19 | 15.pdf | 07/07/2021 16:22 | 07/01/2021 11:51 | 07/16/2021 16:26 | ||
20 | 16.pdf | 07/08/2021 16:20 | 07/01/2021 11:51 | 07/17/2021 16:26 | ||
21 | 1.JPG | 08/01/2021 16:18 | 07/01/2021 11:51 | 08/18/2021 16:26 | ||
22 | 18.JPG | 08/02/2021 16:19 | 07/01/2021 11:51 | 08/19/2021 16:26 | ||
23 | 19.AVI | 08/03/2021 16:22 | 07/01/2021 11:51 | 08/20/2021 16:26 | ||
24 | 20.pdf | 08/04/2021 16:23 | 07/01/2021 11:51 | 08/21/2021 16:26 | ||
25 | 21.pdf | 08/05/2021 16:24 | 07/01/2021 11:51 | 08/22/2021 16:26 | ||
sheet1 |
and what I want
1.xlsm | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | |||
1 | |||||||||||||||||||
2 | JUNE | JULY | AUGUSTS | ||||||||||||||||
3 | ITEM | file name | file creation date | the last entry date | the last modified date | ITEM | file name | file creation date | the last entry date | the last modified date | ITEM | file name | file creation date | the last entry date | the last modified date | ||||
4 | 1 | mm.xlsm | 06/29/2021 16:24 | 07/01/2021 11:51 | 06/29/2021 16:26 | 1 | 8.pdf | 06/29/2021 16:27 | 07/01/2021 11:51 | 07/09/2021 16:26 | 1 | 1.JPG | 08/01/2021 16:18 | 07/01/2021 11:51 | 08/18/2021 16:26 | ||||
5 | 2 | mr excel.xlsx | 06/29/2021 16:05 | 07/01/2021 15:07 | 06/30/2021 16:26 | 2 | 9.pdf | 07/01/2021 16:24 | 07/01/2021 11:51 | 07/10/2021 16:26 | 2 | 18.JPG | 08/02/2021 16:19 | 07/01/2021 11:51 | 08/19/2021 16:26 | ||||
6 | 3 | TR1.xlsx | 06/29/2021 16:15 | 07/01/2021 15:07 | 06/30/2021 16:26 | 3 | 10.pdf | 07/02/2021 16:25 | 07/01/2021 11:51 | 07/11/2021 16:26 | 3 | 19.AVI | 08/03/2021 16:22 | 07/01/2021 11:51 | 08/20/2021 16:26 | ||||
7 | 4 | 1.pdf | 06/29/2021 16:15 | 07/01/2021 15:07 | 06/30/2021 16:26 | 4 | 11.pdf | 07/03/2021 16:26 | 07/01/2021 11:51 | 07/12/2021 16:26 | 4 | 20.pdf | 08/04/2021 16:23 | 07/01/2021 11:51 | 08/21/2021 16:26 | ||||
8 | 5 | 2.pdf | 06/29/2021 16:15 | 07/01/2021 15:07 | 06/30/2021 16:26 | 5 | 12.pdf | 07/04/2021 16:27 | 07/01/2021 11:51 | 07/13/2021 16:26 | 5 | 21.pdf | 08/05/2021 16:24 | 07/01/2021 11:51 | 08/22/2021 16:26 | ||||
9 | 6 | 3.pdf | 06/29/2021 16:15 | 07/01/2021 15:07 | 06/30/2021 16:26 | 6 | 13.pdf | 07/05/2021 16:28 | 07/01/2021 11:51 | 07/14/2021 16:26 | |||||||||
10 | 7 | 4.pdf | 06/29/2021 16:23 | 07/01/2021 11:51 | 06/30/2021 16:26 | 7 | 14.pdf | 07/06/2021 16:29 | 07/01/2021 11:51 | 07/15/2021 16:26 | |||||||||
11 | 8 | 5.pdf | 06/29/2021 16:24 | 07/01/2021 11:51 | 06/30/2021 16:26 | 8 | 15.pdf | 07/07/2021 16:22 | 07/01/2021 11:51 | 07/16/2021 16:26 | |||||||||
12 | 9 | 6.pdf | 06/29/2021 16:25 | 07/01/2021 11:51 | 06/30/2021 16:26 | 9 | 16.pdf | 07/08/2021 16:20 | 07/01/2021 11:51 | 07/17/2021 16:26 | |||||||||
13 | 10 | 7.pdf | 06/29/2021 16:26 | 07/01/2021 11:51 | 06/30/2021 16:26 | ||||||||||||||
14 | |||||||||||||||||||
ss |
thanks in advance