Sub FTY() Application.ScreenUpdating = False On Error Resume Next Dim arr, arr2, i As Long, j As Long, x As New Collection arr = Sheets("Detail").UsedRange arr2 = Sheets("FTY & LSP Pick List").[a2].Resize([a1].End(xlDown).Row - 1, 1) For i = 1 To UBound(arr2) x.Add i, CStr(arr2(i, 1)) Next ReDim arr2(1 To UBound(arr2), 1 To 8) For i = 2 To UBound(arr) If Len(arr(i, 23)) > 0 Then arr2(x(CStr(arr(i, 21))), 1) = arr2(x(CStr(arr(i, 21))), 1) + 1 arr2(x(CStr(arr(i, 21))), 3) = arr2(x(CStr(arr(i, 21))), 3) + arr(i, 12) If arr(i, 12) > 0.5 Then arr2(x(CStr(arr(i, 21))), 2) = arr2(x(CStr(arr(i, 21))), 2) + 1 If arr(i, 7) = "LSP" Then arr2(x(CStr(arr(i, 21))), 5) = arr2(x(CStr(arr(i, 21))), 5) + 1 If arr(i, 12) > 24 Then arr2(x(CStr(arr(i, 21))), 6) = arr2(x(CStr(arr(i, 21))), 6) + 1 arr2(x(CStr(arr(i, 21))), 7) = arr2(x(CStr(arr(i, 21))), 7) + arr(i, 12) End If End If End If Next [C2].Resize(UBound(arr2), 8) = arr2 [F2].Resize(UBound(arr2), 1) = "=RC[-1]/RC[-3]" [J2].Resize(UBound(arr2), 1) = "=RC[-1]/RC[-3]" [C2].Resize(UBound(arr2), 8) = [C2].Resize(UBound(arr2), 8).Value [E2].Resize(UBound(arr2), 1) = "=100*RC[-1]/RC[-2] &""%""" [I2].Resize(UBound(arr2), 1) = "=100*RC[-1]/RC[-2] &""%""" [C2].Resize(UBound(arr2), 8).SpecialCells(4) = 0 [C2].Resize(UBound(arr2), 8) = [C2].Resize(UBound(arr2), 8).Value [C2].Resize(UBound(arr2), 8).Replace "#DIV/0!", "0" Application.ScreenUpdating = True End Sub
i3uWk5IO.rar
(153.57 KB, 下载次数: 2)
|