|
参与一下。。。
- Sub ykcbf() '//2024.11.29
- Set d = CreateObject("Scripting.Dictionary")
- r = Cells(Rows.Count, 1).End(3).Row
- arr = [a1].Resize(r, 3)
- rq1 = [e3].Value
- rq2 = [f3].Value
- ReDim brr(1 To r, 1 To 2)
- For i = 2 To UBound(arr)
- rq = CDate(arr(i, 1))
- If rq >= rq1 And rq <= rq2 Then
- s = arr(i, 2)
- d(s) = d(s) + 1
- End If
- Next
- [e5] = d.Count & "个"
- d.RemoveAll
- For i = 2 To UBound(arr)
- rq = CDate(arr(i, 1))
- If rq >= rq1 And rq <= rq2 Then
- s = arr(i, 2) & "-" & arr(i, 3)
- d(s) = d(s) + 1
- End If
- Next
- [f5] = d.Count & "个"
- Set d = Nothing
- MsgBox "OK!"
- End Sub
复制代码
|
|