|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub lqxs()
- Dim d, Arr, i&, j&
- Set d = CreateObject("Scripting.Dictionary")
- Sheet1.Activate
- Arr = [a1].CurrentRegion
- [q3:q19].Interior.ColorIndex = xlNone
- For i = 3 To UBound(Arr)
- d(Arr(i, 17)) = d(Arr(i, 17)) + Arr(i, 18)
- Next
- For j = 2 To UBound(Arr, 2) - 4 Step 3
- For i = 3 To UBound(Arr)
- If Arr(i, j) = "" Then Exit For
- If d.exists(Arr(i, j)) Then
- Cells(i, j + 1) = d(Arr(i, j))
- Else
- Cells(i, 17).Interior.ColorIndex = 6
- End If
- Next
- Next
- MsgBox "OK"
- End Sub
复制代码 |
|