- ©«¤l
- 2834
- ¥DÃD
- 10
- ºëµØ
- 0
- ¿n¤À
- 2890
- ÂI¦W
- 0
- §@·~¨t²Î
- ¡e²¤¡f
- ³nÅ骩¥»
- ¡e²¤¡f
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¡e²¤¡f
- µù¥U®É¶¡
- 2013-5-13
- ³Ì«áµn¿ý
- 2024-11-23
|
«Øij¥Î16¼Ósamwang ¤jªº¤èªk...¥Î¨â¦¸°j°é~~
¥H¤U¨âºØ¥N½X¶È¨Ñ°Ñ¦Ò, Ãø¥H²z¸Ñ, ¤£·Q¦h°µ¸ÑÄÀ¤F!
Sub TEST_A1()
Dim Arr, Brr, Crr, xD, S As Worksheet, SN$, T$, U&, i&, j%, k&, N&, P%
Set xD = CreateObject("Scripting.Dictionary")
ReDim Brr(1 To 30000, 1 To 4): Crr = Brr
For Each S In Sheets
Arr = S.[a1].CurrentRegion: SN = S.Name
If Not SN Like "*#¤é" Then GoTo x01
For i = 2 To UBound(Arr)
T = Arr(i, 1) & "|" & Arr(i, 2) & "|" & Arr(i, 3)
k = k + 1: Crr(k, 4) = SN: U = xD(T): P = 0
If U > 0 Then N = N + 1: P = 1
For j = 1 To 4
If j < 4 Then Crr(k, j) = Arr(i, j)
If U > 0 Then Brr(N, j) = Crr(U, j): xD(T) = -1
If U < 0 Or P = 1 Then Brr(N + 1, j) = Crr(k, j)
Next j
If xD(T) = 0 Then xD(T) = k Else N = N + 1
i01: Next i
x01: Next
With Sheets("Á`ªí")
.[a1].CurrentRegion.Offset(1).ClearContents
If N > 0 Then .[a2].Resize(N, 4) = Brr
End With
End Sub
'============================
Sub TEST_A2()
Dim Arr, Brr, Crr, xD, S As Worksheet, SN$, T$, i&, j%, k&, N&
Set xD = CreateObject("Scripting.Dictionary")
ReDim Brr(1 To 30000, 1 To 4): Crr = Brr
For Each S In Sheets
Arr = S.[a1].CurrentRegion: SN = S.Name
If Not SN Like "*#¤é" Then GoTo x01
For i = 2 To UBound(Arr)
k = k + 1: Crr(k, 4) = SN: T = "": U = 0
For j = 1 To 3
T = T & "|" & Arr(i, j)
Crr(k, j) = Arr(i, j)
Next j
If xD(T) = 0 Then xD(T) = k: GoTo i01
If xD(T) > 0 Then U = xD(T): N = N + 1: xD(T) = -1
For j = 1 To 4
If U > 0 Then Brr(N, j) = Crr(U, j)
Brr(N + 1, j) = Crr(k, j)
Next
N = N + 1
i01: Next i
x01: Next
With Sheets("Á`ªí")
.[a1].CurrentRegion.Offset(1).ClearContents
If N > 0 Then .[a2].Resize(N, 4) = Brr
End With
End Sub
'====================================== |
|