|
- Sub Adele()
- Dim rng As Range, d As Object
- Set d = CreateObject("scripting.dictionary")
- arr = Range("a1").CurrentRegion
- For x = 1 To UBound(arr)
- If Not d.exists(arr(x, 2)) Then
- d(arr(x, 2)) = x
- Else
- d(arr(x, 2)) = d(arr(x, 2)) & "," & x
- End If
- Next x
- t = d.items
- For y = 0 To UBound(t)
- If InStr(t(y), ",") Then
- s = Split(t(y), ",")
- For Z = 0 To UBound(s)
- If rng Is Nothing Then
- Set rng = Rows(s(Z))
- Else
- Set rng = Union(rng, Rows(s(Z)))
- End If
- Next Z
- End If
- Next y
- If Not rng Is Nothing Then
- rng.Rows.Interior.ColorIndex = 6
- End If
- End Sub
复制代码 |
|