|
- ub 同夹_多薄_多表_合并成一薄一表_数组法()
- Cells.Clear
- 时间 = Timer
- Dim 结果数组(1 To 65536, 1 To 12)
- 路径 = ThisWorkbook.Path & ""
- 外薄 = Dir(路径 & "*.xls*")
- Application.ScreenUpdating = False
- Do While 外薄 <> ""
- If 外薄 <> ThisWorkbook.Name Then
- With Workbooks.Open(路径 & 外薄)
- For Each 外表 In .Sheets
- If Len(外表.[A1]) Then
- 外数组 = 外表.[A1].CurrentRegion
- For i = 2 To UBound(外数组)
- If Len(外数组(i, 1)) Then
- 计数器 = 计数器 + 1
- For j = 1 To UBound(结果数组, 2)
- 结果数组(计数器, j) = 外数组(i, j)
- Next
- End If
- Next
- End If
- Next
- .Close False
- End With
- End If
- 外薄 = Dir
- Loop
- [A2].Resize(计数器, 12) = 结果数组
- Application.ScreenUpdating = True
- MsgBox Timer - 时间
- End Sub
复制代码 |
评分
-
2
查看全部评分
-
|