|
參與一下。。
- Sub ykcbf() '//2024.8.4
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- Set sh = ThisWorkbook.Sheets("Text 1")
- With Application.FileDialog(msoFileDialogFilePicker)
- .InitialFileName = ThisWorkbook.Path & ""
- .Title = "请选择对应Excel文件"
- .AllowMultiSelect = False
- .Filters.Clear
- .Filters.Add "Excel文件", "*.xls*"
- If .Show Then f = .SelectedItems(1) Else Exit Sub
- End With
- ReDim brr(1 To 100000, 1 To 100)
- Set wb = Workbooks.Open(f, 0)
- For Each sht In wb.Sheets
- m = m + 1
- sum1 = 0: sum2 = 0: sum4 = 0: sum5 = 0: n = 0
- With sht
- r = .Cells(Rows.Count, 1).End(3).Row
- arr = .[a1].Resize(r, 5)
- fn = Replace(.Name, "__", "_")
- fn = Split(fn, "_")
- End With
- brr(m, 1) = fn(2)
- brr(m, 2) = fn(0)
- For i = 2 To UBound(arr)
- n = n + 1
- If InStr(arr(i, 5), "Trados") Then sum1 = sum1 + 1
- If InStr(arr(i, 5), "其他") Then sum2 = sum2 + 1
- If arr(i, 4) <> Empty Then sum4 = sum4 + 1
- If InStr(arr(i, 5), "Trados") Then sum5 = sum5 + arr(i, 3)
- Next
- brr(m, 3) = sum1
- brr(m, 4) = sum2
- brr(m, 5) = n - sum1 - sum2
- brr(m, 6) = sum4
- brr(m, 7) = sum5
- Next
- wb.Close 0
- With sh
- .UsedRange.Offset(1).ClearContents
- .[a2].Resize(m, 7) = brr
- End With
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|