- ©«¤l
- 455
- ¥DÃD
- 111
- ºëµØ
- 0
- ¿n¤À
- 563
- ÂI¦W
- 234
- §@·~¨t²Î
- Windows 10
- ³nÅ骩¥»
- Office 2019
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2013-11-7
- ³Ì«áµn¿ý
- 2024-11-25
|
¦^´_ 12# samwang
Dear samwang,
¦¦w¡I§Ú§ï¤F»yªk¦p¤U¡A¦ý¤´¥X²{¿ù»~400ªºµe±
Sub test()
Dim Arr, xD, Brr(), T$, T1$, i&, n%, m%
Set xD = CreateObject("Scripting.Dictionary")
Arr = Range([01!a1], [01!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 Sheets("02").Range("g2").Resize(n, 3)
.Value = Brr
.Sort Key1:=.Item(1), Order1:=1, _
Key2:=.Item(2), Order2:=1, Header:=2
End With
End Sub |
|