|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub 突出显示()
- Set d = VBA.CreateObject("Scripting.Dictionary")
- With ActiveSheet
- arr = .UsedRange
- For i = 3 To UBound(arr)
- If arr(i, 1) <> "" Then
- s = arr(i, 1) & "|" & arr(i, 2) & "|" & arr(i, 3)
- If Not d.exists(s) Then Set d(s) = New Collection
- d(s).Add "a" & i
- End If
- Next
- For i = 3 To UBound(arr)
- If arr(i, 5) <> "" Then
- s = arr(i, 5) & "|" & arr(i, 6) & "|" & arr(i, 7)
- If d.exists(s) Then
- Range(d(s)(1)).Resize(1, 3).Font.ColorIndex = 1
- d(s).Remove (1)
- If d(s).Count = 0 Then d.Remove s
- Else
- Cells(i, 5).Resize(1, 3).Font.ColorIndex = 3
- End If
- End If
- Next
- End With
- End Sub
复制代码 |
|