|
▼candle さん:
一応、実行して確認しましたのでアップします。
まだ要件を取り違えていれば指摘願います。
Sub Sample3()
Dim fso As Object
Dim x As Long
Dim pfold As Object
Dim cfold As Object
Dim mfold As Object
Dim cnt As Long
Columns("A:B").ClearContents
Set fso = CreateObject("Scripting.FileSystemObject")
For Each pfold In fso.getfolder("c:\フォルダ個数").subfolders
x = x + 1
Range("A" & x).Value = pfold.Name
cnt = 0
For Each cfold In pfold.subfolders
For Each mfold In cfold.subfolders
cnt = cnt + 1
Next
Range("B" & x).Value = cnt
Next
Next
End Sub
|
|