|
Sub xx()
Dim r%, i%, arr, arr1, d As Object, str As String, m
Set d = CreateObject("scripting.dictionary")
With Worksheets("sheet1")
r = .Cells(.Rows.Count, 1).End(xlUp).Row
arr = .Range("a1:E" & r)
For i = 2 To UBound(arr)
str = arr(i, 1) & "|" & arr(i, 2) & "|" & arr(i, 3) & "|" & arr(i, 4)
If Not d.exists(str) Then
Set d(str) = CreateObject("scripting.dictionary")
End If
d(str)(arr(i, 5)) = ""
Next i
For i = 0 To d.Count - 1
arr1 = d(d.keys()(i)).keys
m = Application.Small(arr1, 1)
t = t + 1
.Cells(t + 1, 8).Resize(1, 4) = Split(d.keys()(i), "|")
.Cells(t + 1, 12) = m
Next i
End With
End If
End Sub
求助VBA语句转换到VB.NET语法里面,完全搞不懂 ,求各位大师解惑,谢谢
|
|