- ©«¤l
- 976
- ¥DÃD
- 7
- ºëµØ
- 0
- ¿n¤À
- 1018
- ÂI¦W
- 0
- §@·~¨t²Î
- Win10
- ³nÅ骩¥»
- Office 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2013-4-19
- ³Ì«áµn¿ý
- 2024-10-30
|
¦^´_ 1# jsc0518
½Ð´ú¸Õ¬Ý¬Ý¡AÁÂÁÂ
Sub test()
Dim Arr, xD, Brr(), T$, T1$, i&, n%, m%
Set xD = CreateObject("Scripting.Dictionary")
Arr = Range([a1], [c65536].End(3))
ReDim Brr(1 To UBound(Arr), 1 To 3)
For i = 2 To UBound(Arr)
T = Arr(i, 2) & "|" & Arr(i, 3)
T1 = Arr(i, 1) & "|" & Arr(i, 2) & "|" & Arr(i, 3)
If xD.Exists(T) Then
m = xD(T)
If Not xD.Exists(T1) Then Brr(m, 3) = Brr(m, 3) + 1
Else
n = n + 1: xD(T) = n: xD(T1) = n
Brr(n, 1) = Arr(i, 2)
Brr(n, 2) = Arr(i, 3)
Brr(n, 3) = 1
End If
Next
With Range("g2").Resize(n, 3)
.Value = Brr
.Sort Key1:=.Item(1), Order1:=1, _
Key2:=.Item(2), Order2:=1, Header:=2
End With
End Sub |
|