|
- Sub Macro1()
- Dim arr, d, i&, sz&
- Set d = CreateObject("scripting.dictionary")
- arr = Range("a1").CurrentRegion
- With CreateObject("vbscript.regexp")
- .Pattern = "^[a-zA-Z]+"
- .Global = True
- For i = 1 To UBound(arr)
- sz = Val(.Replace(arr(i, 1), ""))
- Set ms = .Execute(arr(i, 1))
- If Not d.exists(ms(0)) Then
- d(Trim(ms(0))) = sz
- Else
- If d(Trim(ms(0))) < sz Then d(Trim(ms(0))) = sz
- End If
- Next
- End With
- [c:d].ClearContents
- Range("c1").Resize(d.Count) = Application.Transpose(d.keys)
- Range("d1").Resize(d.Count) = Application.Transpose(d.items)
- End Sub
复制代码 ………………
|
评分
-
查看全部评分
|