|
- Sub lqxs()
- Dim myPath$, myName$, wb As Workbook
- Dim funm$, n&, m&
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- Set wb = ThisWorkbook
- funm = ThisWorkbook.Name
- Sheet1.Activate
- Cells.Clear: n = 1
- myPath = ThisWorkbook.Path & ""
- myName = Dir(myPath & "*.xls")
- Do While myName <> "" And myName <> funm
- With GetObject(myPath & myName)
- .Sheets(1).UsedRange.Copy Cells(n, 1)
- .Close False
- m = .Sheets(1).UsedRange.Rows.Count + 2
- End With
- n = n + m
- myName = Dir
- Loop
- Application.ScreenUpdating = True
- End Sub
复制代码 |
|