|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub 每天()
- Dim r%, i%
- Dim arr, brr
- Dim d As Object
- Set d = CreateObject("scripting.dictionary")
- With Worksheets("每天")
- r = .Cells(.Rows.Count, 1).End(xlUp).Row
- arr = .Range("c3:v" & r)
- .Range("c3:v" & r).Interior.Color = 16772537
- ReDim brr(1 To UBound(arr), 1 To UBound(arr, 2))
- For i = UBound(arr) To 2 Step -1
- d.RemoveAll
- For j = 1 To UBound(arr, 2)
- d(arr(i, j)) = Empty
- Next
- n = 0
- For j = 1 To UBound(arr, 2)
- If d.exists(arr(i - 1, j)) Then
- .Cells(i - 1 + 2, j + 2).Interior.ColorIndex = 3
- n = n + 1
- brr(i - 1, n) = arr(i - 1, j)
- End If
- Next
- Next
- .Range("x3").Resize(UBound(brr), UBound(brr, 2)) = brr
- End With
- End Sub
复制代码 |
|