ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

·Q§ä¥X»P«e¤@¦C­«½Æªº¼Æ¦r

¦nªº¡A§Ú¦A´ú¸Õ¬Ý¬Ý¡AÁÂÁ¤j¤j

TOP

PÄæ³]¬°¤å¦r®æ¦¡~~

Sub TEST_A01()
Dim Arr, xD, i&, j%, T$, TT$
Set xD = CreateObject("Scripting.Dictionary")
Arr = Range([m1], [a65536].End(xlUp))
For i = 1 To UBound(Arr)
For j = 1 To UBound(Arr, 2)
    T = Arr(i, j): xD(T & "/" & i) = 1
    If xD(T & "/" & i - 1) = 1 Then TT = TT & "," & T
Next j
    Arr(i, 1) = Mid(TT, 2): TT = ""
Next i
[p1].Resize(UBound(Arr)) = Arr
End Sub


'==============================

TOP

¦r¨åÀH¨úÀH®ø, ´î¤Ö¦û¥Î¸ê·½~~

Sub TEST_A02()
Dim Arr, Brr, xD, i&, j%, TT$
Set xD = CreateObject("Scripting.Dictionary")
Arr = Range([m1], [a65536].End(xlUp))
ReDim Brr(1 To UBound(Arr), 0)
For i = 2 To UBound(Arr)
    For j = 1 To UBound(Arr, 2)
        xD(Arr(i - 1, j) & "") = 1
    Next j
    For j = 1 To UBound(Arr, 2)
        If xD(Arr(i, j) & "") = 1 Then TT = TT & "," & Arr(i, j)
    Next j
    Brr(i, 0) = Mid(TT, 2): TT = "": xD.RemoveAll
Next i
[p1].Resize(UBound(Brr)) = Brr
End Sub


.==============================

TOP

¦^´_ 13# ­ã´£³¡ªL

¦r¨åÀH¨úÀH®ø, ´î¤Ö¦û¥Î¸ê·½~~
>> ·PÁ­ã¤j¤À¨É¡A¼g±oºë²¤F¡Aµo²{¦Û¤v¼gªº¤Ó½ÆÂø¡A#12¼Óªº¼gªk²Ä1¦¸¬Ý¹L¡A
¯uªº¤£¦n²z¸Ñ¡A­n¦n¦nªº¬ã¨s¾Ç²ß¤@¤U¡AÁÂÁ¡C

TOP

¦^´_ 14# samwang


12F

Åý¦r¨åªºkey§¨±a i ­È
·í i=1 ®É
±N xd(T & "/" & 1)=1 ¥[¤J¦r¨å,
¦P®ÉÀˬd xd(T & "/" &  0) ¬O§_¦b¦r¨å¤¤, ¦]¬O²Ä1¦æ, ©Ò¥H³£¬°"ªÅ­È",

·í i=2 ®É
±N xd(T & "/" & 2)=1 ¥[¤J¦r¨å,
¦P®ÉÀˬd xd(T & "/" &  1) ¬O§_¦b¦r¨å¤¤, ¦]¬O²Ä2¦æ, ¥u­n¦r¨åkey±a1ªº, §Y¬O¤W¤U¦æ¬Û¦P

Ãþ±À~~
³o¤èªkÅý©Ò¦³¼Æ¦r³£¦]¦æ¸¹¤£¦P¦Ó¥þ³¡¯Ç¤J¦r¨å, ¦U¦Û¦¨¬°¿W¥ßªºkey­È,
¯ÊÂI: ¦r¨å·|©ñ¤Ó¦h¸ê®Æ

TOP

ÁÂÁ½׾Â,ÁÂÁ¦U¦ì«e½ú
«á¾ÇÂǦ¹©«½m²ß°}¦C,¾Ç²ß¤è®×¦p¤U,½Ð¦U¦ì«e½ú«ü±Ð

°õ¦æµ²ªG:



Option Explicit
Sub TEST()
Dim Brr, i&, j%, A$, Q$, TT$, T$
'¡ô«Å§iÅܼÆ
Brr = Range([M1], [A65536].End(xlUp))
'¡ô¥OBrrÅܼƬO ¤Gºû°}¦C,¥HA~MÄæÀx¦s®æ­È±a¤J°}¦C¤¤
For i = 1 To UBound(Brr)
'¡ô³]¶¶°j°éi
   For j = 1 To UBound(Brr, 2)
   '¡ô³]¶¶°j°éj
      T = Brr(i, j)
      '¡ô¥OTÅܼƬO °j°éBrr°}¦C­È
      If InStr(A, "/" & T & "/") Then TT = TT & "," & T
      '¡ô¦pªGAÅÜ¼Æ ¥]§t¤F¥H(TÅܼƦb«e«á¥]§¨"/"ªº·s¦r¦ê)??
      '¡ô¥OTÅܼƯǤJTTÅܼƫá¤è,¥H³rÂI¹j¶},¦¨¬°·s¦r¦ê
      '(·íi=1®É,A¬Oªì©l­È"",©Ò¥H±ø¥ó³£¤£·|¦¨¥ß)

      Q = Q & "/" & T & "/"
      '¡ô¥OQÅܼƦ¬¶°¸Ó°j°éªº°}¦C­È,°µ¬°¤U¤@°j°éªºAÅܼÆ
   Next j
   Brr(i, 1) = Mid(TT, 2): TT = "": A = Q: Q = ""
   '¡ô¥OBrr°}¦C²Ä1Äæ¼g¤J²Å¦X±ø¥óªº¼Æ¦r
Next i
[P1].Resize(UBound(Brr)) = Brr
'¡ô¥OBrr°}¦C­È±q[P1]¶}©l¼g¤JÀx¦s®æ¸Ì,¶W¹L¦¹½d³òªº°}¦C­È©¿²¤
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

        ÀR«ä¦Û¦b : ª¾ÃÑ­n¥Î¤ßÅé·|¡A¤~¯àÅܦ¨¦Û¤vªº´¼¼z¡C
ªð¦^¦Cªí ¤W¤@¥DÃD