|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub test1()
- Dim fso As New filesystemobject, mysubfolder, k&, st$, filename$, wb As Workbook, x&
- ThisWorkbook.Sheets(1).Range("a2:g1048576") = ""
- st = ThisWorkbook.Path & "" & "人员"
- For Each mysubfolder In fso.GetFolder(st).SubFolders
- filename = Dir(mysubfolder & "\周会数据.xlsx")
- Set wb = Workbooks.Open(mysubfolder & "" & filename)
- x = ThisWorkbook.Sheets(1).Cells(Rows.Count, 1).End(xlUp).Row + 1
- With wb
- .Sheets(1).Range("a1").CurrentRegion.Offset(1, 0).Copy ThisWorkbook.Sheets(1).Cells(x, 1)
- .Close
- End With
- filename = Dir
- Next mysubfolder
- End Sub
复制代码 |
|