|
楼主 |
发表于 2017-7-25 20:51
|
显示全部楼层
改了改,发现可以用了,代码贴出来:
- Sub lkyy()
- Dim wb As Workbook, Mp$, Mf
- Mp = ThisWorkbook.Path & ""
- Mf = Dir(Mp & "*.xlsx")
- ReDim br(1 To 500, 1 To 10)
- Do While Mf <> ""
- With Workbooks.Open(Mp & Mf)
- n = n + 1
- ar = .Sheets("Page 1").Range("a1").CurrentRegion
- br(n, 1) = ar(3, 2)
- br(n, 2) = ar(4, 2)
- For i = 3 To 9
- br(n, i) = ar(i + 3, 2)
- Next
- For y = 150 To 20 Step -1
- If Cells(y, 1) = "" Then
- w = y - 1
- End If
- Next
- For i = 14 To w
- If i = 14 Then s = ar(i, 1) Else s = s & "|" & ar(i, 1)
- Next
- br(n, 10) = s
- .Close 0
- End With
- Mf = Dir()
- Loop
- Range("a2:j1000").ClearContents
- Range("a2").Resize(n, 10) = br
- End Sub
复制代码 |
|