[µo°Ý]§R°£¤£«½Æªº¸ê®Æ,¥u¯d¤U«½Æªº¸ê°T
- ©«¤l
- 38
- ¥DÃD
- 7
- ºëµØ
- 0
- ¿n¤À
- 48
- ÂI¦W
- 0
- §@·~¨t²Î
- win8
- ³nÅ骩¥»
- office2010
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2015-4-30
- ³Ì«áµn¿ý
- 2016-12-5
|
[µo°Ý]§R°£¤£«½Æªº¸ê®Æ,¥u¯d¤U«½Æªº¸ê°T
|
|
|
|
|
|
- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 1# boblovejoyce
¸Õ¸Õ¬Ý- Option Explicit
- Sub EX()
- Dim D As Object, DD As Object, E As Variant, Ar(), S As String, i As Integer
- Set D = CreateObject("SCRIPTING.DICTIONARY")
- 'Dictionary ª«¥ó»P PERL ¬ÛÃö°}¦C¥þµ¥¡C¥i¥H¬O¥ô¦ó«¬¦¡ªº¸ê®Æªº¶µ¥Ø³QÀx¦s¦b°}¦C¤¤¡C¨CÓ¶µ¥Ø³£»P¤@Ӱߤ@ªºÃöÁä¦r¬ÛÃö¡C¸ÓÃöÁä¦r¥Î¨Ó¨ú¥X³æÓ¶µ¥Ø¡A³q±`¬O¾ã¼Æ©Î¦r¦ê¡A¥i¥H¬O°£°}¦C¥~ªº¥ô¦ó«¬ºA¡C
- Set DD = CreateObject("SCRIPTING.DICTIONARY")
- With Range("A1").CurrentRegion
- 'CurrentRegion ÄÝ©Ê ¶Ç¦^ Range ª«¥ó¡A¸Óª«¥ó¥Nªí¥Ø«eªº°Ï°ì¡C¥Ø«e°Ï°ì¬O«ü¥H¥ô·NªÅ¥Õ¦C¤ÎªÅ¥ÕÄ檺²Õ¦X¬°Ãä¬Éªº½d³ò¡C°ßŪ¡C
- For Each E In .Rows
- S = E.Cells(1, 2) & "-" & E.Cells(1, 3)
- If D.Exists(S) Then '¦r¨åª«¥ó ªºÃöÁä¦r¦s¦b
- Ar = D(S)
- ReDim Preserve Ar(1 To 3, 1 To UBound(Ar, 2) + 1)
- 'Preserve ¿ï¾Ü©Ê¤Þ¼Æ¡C·í§ïÅÜ즳°}¦C³Ì«á¤@ºûªº¤j¤p®É¡A¤´µM«O¦³ì¨Óªº¸ê®ÆªºÃöÁä¦r¡C
- For i = 1 To 3
- Ar(i, UBound(Ar, 2)) = E.Cells(1, i)
- Next
- D(S) = Ar
- DD(S) = Ar
- Else
- D(S) = Application.Transpose(E)
- End If
- Next
- End With
- For Each E In DD.ITEMS '¦r¨åª«¥óªº¶µ¥Ø
- With Range("F" & Rows.Count).End(xlUp).Offset(1)
- Ar = Application.Transpose(E)
- .Resize(UBound(Ar), 3) = Ar
- End With
- Next
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|
- ©«¤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
|
ÁÂÁ½׾Â,ÁÂÁ¦U¦ì«e½ú
«á¾ÇÂǦ¹©«½m²ß°}¦C»P¦r¨å,¾Ç²ß¤è®×¦p¤U,½Ð¦U¦ì«e½ú«ü±Ð
°õ¦æ«e:
°õ¦æµ²ªG:
Option Explicit
Sub TEST()
Dim Brr, Crr(1 To 100, 1 To 3), A, Y, i&, j%, T1$, T2$, T3$, TT$, N%
Dim xR As Range, Ra As Range, Sh As Worksheet, xBook As Workbook
Set Y = CreateObject("Scripting.Dictionary")
Brr = Range([C1], Cells(Rows.Count, 1).End(3))
For i = 2 To UBound(Brr)
T1 = Brr(i, 1): T2 = Brr(i, 2): T3 = Brr(i, 3): TT = T2 & "/" & T3
A = Y(TT): N = Y(TT & "|R"): N = N + 1
If Not IsArray(A) Then A = Crr
For j = 1 To 3: A(N, j) = Brr(i, j): Next
Y(TT) = A: Y(TT & "|R") = N
Next
[K:M].ClearContents: [K1:M1] = [{"«¬¸¹","®y¼ÐX","®y¼ÐY"}]: N = 2
For Each A In Y.KEYS
If InStr(A, "|") Then GoTo i01
If Y(A & "|R") = 1 Then GoTo i01
Cells(N, "K").Resize(Y(A & "|R"), 3) = Y(A)
N = N + Y(A & "|R")
i01: Next
Set Y = Nothing: Erase Brr, Crr
End Sub |
|
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y
|
|
|
|
|