I was getting help from Jakobshavn (Thanks Again) on working on the code on this link Orginal Thread
here is the code
Sub FileCounter()
s = GetFolder & "/*.*"
Filename = Dir(s)
Do Until Filename = ""
i = i + 1
Filename = Dir()
Loop
Range("A1").Value = s
Range("B1").Value = i
End Sub
Function GetFolder() As String
Dim fldr As FileDialog
Dim sItem As String
Set fldr = Application.FileDialog(msoFileDialogFolderPicker)
With fldr
.Title = "Select a Folder"
.AllowMultiSelect = False
.InitialFileName = Application.DefaultFilePath
If .Show <> -1 Then GoTo NextCode
sItem = .SelectedItems(1)
End With
NextCode:
GetFolder = sItem
Set fldr = Nothing
End Function
How can I get this to read every folder from a main folder and list the number of contents in the sub folder?
Example X:\YYZ = Main Folder
1 = sub folder
12 files
2 = sub folder
1 file
3 = sub folder
101 files
Bookmarks