2
2
'Variable Declaration
Dim shtFldDetails As Worksheet
Dim sRootFolderName As String
'If path is not available, it display message and exit from the procedure
If sRootFolderName = "\" Then
MsgBox "Please select folder to find list of folders and Subfolders",
vbInformation, "Input Required!"
Exit Sub
End If
'Clear Sheet
shtFldDetails.Cells.Clear
With shtFldDetails
'Merge Header cells
.Range("A1:H1").Merge
'Create Headers
.Range("A2") = "Folder Path"
.Range("B2") = "Short Folder Path"
.Range("C2") = "Folder Name"
.Range("D2") = "Short Folder Name"
.Range("E2") = "Number of Subfolders"
.Range("F2") = "Number of Files"
.Range("G2") = "Folder Size"
.Range("H2") = "Folder Create Date"
.Range("A2:H2").Font.Bold = True
End With
End Sub
'Variable Declaration
Dim oFSO As Object, oSourceFolder As Object, oSubFolder As Object
Dim iLstRow As Integer
'Release Objects
Set oSubFolder = Nothing
Set oSourceFolder = Nothing
Set oFSO = Nothing
End Sub
With FldrPicker
.Title = "Browse Root Folder Path"
.AllowMultiSelect = False
If .Show <> -1 Then Exit Function
myPath = .SelectedItems(1)
End With
sbBrowesFolder = myPath
If myPath = vbNullString Then Exit Function
End Function