|
Sub 纯数组_跨薄()
Cells.ClearContents
tt = Timer
Dim Mypath$, MyName$, arr, brr(1 To 65536, -1 To 16), i&, j&, m&, sh As Worksheet
Mypath = ThisWorkbook.Path & "\"
MyName = Dir(Mypath & "*.xls")
Application.ScreenUpdating = False
Do While MyName <> ""
If MyName <> ThisWorkbook.Name Then
With Workbooks.Open(Mypath & MyName)
For Each sh In .Sheets
If InStr(sh.Name, "四甲") Then
arr = sh.UsedRange
For i = 1 To UBound(arr)
If Len(arr(i, 1)) Then
m = m + 1
For j = 1 To 16
brr(m, j) = arr(i, j)
Next
brr(m, -1) = MyName
brr(m, 0) = sh.Name
End If
Next
End If
Next
.Close False
End With
End If
MyName = Dir
Loop
[A2].Resize(m, 18) = brr
Application.ScreenUpdating = True
MsgBox "用时" & Format(Timer - tt, "0.00") & "秒", 64, "提示"
End Sub
|
评分
-
1
查看全部评分
-
|