Microsoft Office Tutorials and References
In Depth Information
Creating a List of Files That Reside in a Directory
'Autofit columns B, D and E¶
Range("B:B, D:E").EntireColumn.AutoFit¶
'Restore calculation¶
Application.Calculation = OldCalculation¶
'Restore screen updating¶
Application.ScreenUpdating = True¶
End Sub¶
In the 'Change the following variables' section, you can change these two
Path: The location of the files
LookInSubFolders: Search in the subfolders as well (True or False)
You can change the properties of the files that are displayed in the worksheet
as well. Within the macro, there is a small list of available properties. To
include any of the listed properties, simply remove the apostrophe in front of
the code for that property line to include it in the data.
Also, be sure to change the “5” in the following line of code to reflect the
number of properties being returned:
With Range("A1").Resize(1, 5)¶
The array also must have the additional headers added to the list after the
“Date created”. Separate the headers with commas.
.Value = Array("Full path", "File name", "Path", _¶
"Size (kB)", "Date created")¶
Search JabSto ::

Custom Search