|
- Private Sub Worksheet_Change(ByVal Target As Range)
- Set d = CreateObject("scripting.dictionary")
- Set d1 = CreateObject("scripting.dictionary")
- Application.ScreenUpdating = False
- Columns("i:l").Interior.ColorIndex = 0
- For j = 5 To Cells(Rows.Count, 9).End(3).Row
- If Cells(j, 9) = [h1] Then
- If Not d.exists(Cells(j, 11).Value) Then
- Set d(Cells(j, 11).Value) = Union(Cells(j, 11), Cells(j, 9))
- Else
- Set d(Cells(j, 11).Value) = Union(d(Cells(j, 11).Value), Cells(j, 11), Cells(j, 9))
- End If
-
- If Not d1.exists(Cells(j, 12).Value) Then
- Set d1(Cells(j, 12).Value) = Cells(j, 12)
- Else
- Set d1(Cells(j, 12).Value) = Union(d1(Cells(j, 12).Value), Cells(j, 12))
- End If
- End If
- Next j
- For Each Rng In d.items
- If Rng.Cells.Count > 2 Then Rng.Interior.ColorIndex = 6
- Next Rng
- For Each Rng In d1.items
- If Rng.Cells.Count > 1 Then Rng.Interior.ColorIndex = 8
- Next Rng
- Application.ScreenUpdating = True
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|