|
参与一下。。。
- Sub ykcbf() '//2024.11.9
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- ReDim brr(1 To 10000, 1 To 100)
- With Sheets("Sheet1")
- r = .Cells(Rows.Count, 1).End(3).Row
- arr = .[a1].Resize(r, 12)
- End With
- For i = 2 To UBound(arr)
- rq = DateValue(arr(i, 11))
- ti = TimeValue(arr(i, 11))
- st = stoc(arr(i, 5))
- s = rq & "|" & st
- If Not d.exists(s) Then
- m = m + 1
- d(s) = m
- brr(m, 1) = m
- brr(m, 2) = rq
- brr(m, 3) = ti
- brr(m, 4) = ti
- brr(m, 5) = st
- brr(m, 6) = arr(i, 9)
- Else
- r = d(s)
- brr(r, 3) = IIf(brr(r, 3) <= ti, brr(r, 3), ti)
- brr(r, 4) = IIf(brr(r, 4) > ti, brr(r, 4), ti)
- brr(r, 6) = brr(r, 6) + arr(i, 9)
- End If
- Next
- With Sheets("Sheet2")
- .UsedRange.Offset(1).Clear
- With .[a2].Resize(m, 6)
- .Value = brr
- .Borders.LineStyle = 1
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- End With
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
2
查看全部评分
-
|