|
参与一下。。。
- Sub ykcbf() '//2024.7.20
- Set fso = CreateObject("scripting.filesystemobject")
- Application.ScreenUpdating = False
- p = ThisWorkbook.Path & ""
- On Error Resume Next
- m = 1
- For Each fd In fso.GetFolder(p).SubFolders
- subFolderExists = (fd.SubFolders.Count > 0)
- If subFolderExists Then
- For Each fd1 In fd.SubFolders
- m = m + 1
- Cells(m, 1) = fd1.Path
- Cells(m, 2) = fd1.Name
- Next
- Else
- m = m + 1
- Cells(m, 1) = fd.Path
- Cells(m, 2) = fd.Name
- End If
- Next
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|