- ©«¤l
- 1446
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1470
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-10-21
|
¦^´_ Andy2483
¥i¥H¤F¡AÁÂÁ¡I
Set xA = Range([1!G1], [1!A65536].End(3))
Intersect([1!M ...
198188 µoªí©ó 2024-3-5 08:58
קאּ¥Îactivesheet´Nn¦bªí "1"¤U°õ¦æ,§_«h·|§ì¤£¨ì¸ê®Æ,
¦pªG¦b¤u§@ªí¤£§ó´«¶¶§Çªº«e´£¤U¥i¥H¥Î¤u§@ªí¯Á¤Þ¸¹
Option Explicit
Sub TEST()
Dim Arr, Brr, Crr, V$, Z, i&, T$, TT$, A, xA As Range, N%
Set Z = CreateObject("Scripting.Dictionary")
Set xA = Range(Sheets(1).[G1], Sheets(1).[B65536].End(3)(1, 0))
xA.Offset(1, 12).Resize(, 3).ClearContents: Brr = xA
For i = 2 To UBound(Brr)
T = Format(Trim(Brr(i, 2)), "0000000"): V = Format(Val(Brr(i, 7)), "0000000"): TT = T & "/" & V
Z(TT) = i
Next
Arr = Sheets(1).[M1].Resize(UBound(Brr), 3)
A = Array(Range([KH!C1], [KH!A65536].End(3)), Range([KH!J1], [KH!H65536].End(3)), Range([KP!C1], [KP!A65536].End(3)), Range([KP!J1], [KP!H65536].End(3)))
For Each Crr In A
Crr = Crr: N = N + 1
For i = 3 To UBound(Crr)
T = Format(Trim(Crr(i, 1)), "0000000"): V = Format(Val(Crr(i, 2)), "0000000"): TT = T & "/" & V
If Z.Exists(TT) Then
If Arr(Z(TT), 1) = "" Then
Arr(Z(TT), 1) = Crr(1, 1)
ElseIf InStr("/" & Arr(Z(TT), 1) & "/", "/" & Crr(1, 1) & "/") = 0 Then
Arr(Z(TT), 1) = Arr(Z(TT), 1) & "/" & Crr(1, 1)
End If
Arr(Z(TT), N \ 3 + 2) = Crr(1, 3)
End If
Next
Next
Sheets(1).[M1].Resize(UBound(Brr), 3) = Arr
End Sub |
|