If .Item(Arr(i, 1)) < Arr(i, 2) Then .Item(Arr(i, 1)) = Arr(i, 2)
Else
.Add Arr(i, 1), Arr(i, 2)
End If
Next i
For Each ViewMax In .Keys
Debug.Print ViewMax, .Item(ViewMax)
Next
End With
End Sub
複製代碼
作者: 准提部林 時間: 2015-10-17 10:57
Sub AR1017()
Dim Arr, xD, j&, T, V
Set xD = CreateObject("Scripting.Dictionary")
Arr = Range([A1], [B65536].End(xlUp))
For j = 1 To UBound(Arr)
T = Arr(j, 1): V = Arr(j, 2)
If xD(T) = "" Then xD(T) = V
If V > xD(T) Then xD(T) = V
Next j
[E1:F1].Resize(xD.Count) = Application.Transpose(Array(xD.keys, xD.items))
End Sub作者: hcm19522 時間: 2015-10-17 11:54