|
- Sub g1()
- Range("A:A").ClearContents '清除
- Dim fso, fl, m&
- Set fso = CreateObject("Scripting.FileSystemObject")
- For Each fl In fso.getfolder(CreateObject("Shell.Application").BrowseForFolder(0, "请选择文件夹", 0, "").Self.Path & "").Files
- If InStr(fl.Name, ThisWorkbook.Name) = 0 Then
- m = m + 1
- Cells(m, 1) = fl.Name
- End If
- Next
- End Sub
复制代码 |
|