|
代码如下。。。
Sub test()
Application.ScreenUpdating = False
Dim sht As Worksheet
p = ThisWorkbook.Path & "\searchstep_T1_0802.xlsx"
ReDim brr(1 To 10000, 1 To 7)
With Workbooks.Open(p, 0)
For Each sht In .Sheets
n = n + 1
brr(n, 1) = Right(sht.Name, 3)
brr(n, 2) = Left(sht.Name, 2)
arr = sht.UsedRange
m = 0: x = 0: y = 0
For i = 2 To UBound(arr)
If arr(i, 5) = "Trados" Then m = m + 1: y = y + arr(i, 3)
If arr(i, 5) = "其他" Then x = x + 1
If Len(arr(i, 4)) > 0 Then Z = Z + 1
Next
brr(n, 3) = m
brr(n, 4) = x
brr(n, 5) = UBound(arr) - 1 - m - x
brr(n, 7) = y
brr(n, 6) = Z
Next
.Close 0
End With
ThisWorkbook.Sheets("Text 1").UsedRange.Offset(1).ClearContents
ThisWorkbook.Sheets("Text 1").[a2].Resize(n, 7) = brr
Beep
Application.ScreenUpdating = False
End Sub
|
|