提取出来指定目录的文件夹名
Sub getFldList1() Dim Fso, Fld Dim Arr(1 To 999), k% Set Fso = CreateObject("Scripting.FileSystemObject") Set Fld = Fso.getfolder(CreateObject("Shell.Application").BrowseForFolder(0, "请选择文件夹", 0, "").Self.Path & "") For Each fd In Fld.subfolders k = k + 1 Arr(k) = fd.Name Next [A1].Resize(k) = Application.Transpose(Arr) End Sub