|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
参与一下。。。- Sub ykcbf() '//2024.1.24
- Set d = CreateObject("Scripting.Dictionary")
- Set sh = ThisWorkbook.Sheets("业务资料移交")
- st = "a工作量统计表"
- With sh
- ks = .[b4]
- rq1 = .[g4]
- rq2 = .[h4]
- End With
- For Each sht In Sheets
- If InStr(sht.Name, st) Then
- With sht
- r = .Cells(Rows.Count, 4).End(3).Row
- arr = .Range("a2:o" & r)
- End With
- For i = 2 To UBound(arr)
- rq = Val(Format(arr(i, 4), "yyyymmdd"))
- If rq >= rq1 And rq <= rq2 Then
- s = arr(i, 9)
- If Not d.exists(s) Then
- d(s) = Array(s, 1)
- Else
- t = d(s)
- t(1) = t(1) + 1
- d(s) = t
- End If
- End If
- Next
- End If
- Next
- With sh
- .[j5:k1000].Clear
- .[j5].Resize(d.Count, 2) = Application.Rept(d.Items, 1)
- .[j5].Resize(d.Count, 2).Borders.LineStyle = 1
- End With
- Set d = Nothing
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|