|
- Sub zz()
- Dim ar, b(), d As Object, rng As Range
- Set d = CreateObject("scripting.dictionary")
- ar = [r7].CurrentRegion.Value
- ReDim b(UBound(ar))
- With CreateObject("vbscript.regexp")
- .Pattern = "\d+"
- .Global = True
- For i = 1 To UBound(ar)
- For Each k In .Execute(ar(i, 1))
- d(Val(k)) = i
- Next
- Next
- End With
- ar = Range("c7:c" & [c65536].End(3).Row).Value
- ReDim b(1 To UBound(ar), 1 To 5)
- For i = 1 To UBound(ar)
- k = ar(i, 1): t = d(k)
- b(i, t) = k
- If rng Is Nothing Then
- Set rng = Cells(i + 6, t + 10)
- Else
- Set rng = Union(rng, Cells(i + 6, t + 10))
- End If
- Next
- [k7].Resize(i - 1, 5).Clear
- [k7].Resize(i - 1, 5) = b
- [k7].Resize(i - 1, 5).Borders.LineStyle = xlDouble
- rng.Interior.Color = vbYellow
- rng.Font.Bold = 1
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|