|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Dim i%
Sub limonet()
Dim Path$
With Application.FileDialog(msoFileDialogFolderPicker)
If .Show Then Path = .SelectedItems(1) Else Exit Sub
End With
Call AllListFSO(Path)
End Sub
Function AllListFSO(Path) As String
Dim Fld As Object, Fd As Object, F As Object
Set Fld = CreateObject("scripting.filesystemobject").getfolder(Path)
For Each F In Fld.Files
i = i + 1
Name F.Path As Fld.Path & "\" & Format(i, "000") & Mid(F.Name, InStrRev(F.Name, "."), 99)
Next F
For Each Fd In Fld.subfolders
AllListFSO (Fd.Path)
Next Fd
End Function |
|