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

[µo°Ý] §â¸ê®Æ¾ã²z¤Î±Æ¦C

[µo°Ý] §â¸ê®Æ¾ã²z¤Î±Æ¦C

sample_001.rar (3.19 KB) §âA1:B11 ¤¤A1ªº¸ê®Æ±Æ¦C¤Î¾ã¦X
§¹¦¨¥Ü½d14¦C¯ë
¦]¬°­n§¹¦¨ªº¤å¥ó¸û¤j,´£·í¤¤¤@¤p³¡©â¥X¥¼¦V¤j®a½Ð±Ð..
·PÁÂÀ°¦£~
excel~ ¾Ç¦n¥L§a

¥»©«³Ì«á¥Ñ chin15 ©ó 2011-4-1 21:23 ½s¿è

³o­ÓÀ³¸Ó¥Îvba§a¡H
excel¨S¦³¾A¦Xªº¤u¨ã°µ¦¹¾Þ§@

sample_001.rar (9.63 KB)

TOP

¤p§Ì¤£¤~~½Ð°Ý¦p¦óÂX¤j¨Ï¥Î½d³ò??²{¦b¥u¯à§âA1-A20 ¤ºªº¸ê®Æ¾ã²z~§Ú»Ý­nÂX¤j¨ì1-25000...
·PÁÂ
excel~ ¾Ç¦n¥L§a

TOP

²{¦b¥u¯à§âA1-A20 ¤ºªº¸ê®Æ¾ã²z~
½T©w¶Ü¡H

TOP

§A¦n~§Ú§â­n¥Îªº¸ê®Æ½Æ¨î¨ìA,B,±Ò¥ÎVBA,°õ¦æ,
¥X²{
°õ¦æ¶¥¬q¿ù»~ '13':
§ÎºA¤£²Å¦X
«ç¼Ë¿ì??
excel~ ¾Ç¦n¥L§a

TOP

¦^´_ 5# kan109
¼g¦¨¦Û©w¸q¨ç¼Æ¨Ó¨Ï¥Î


    sample_001.rar (9.15 KB)
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

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

°õ¦æ«e:


°õ¦æµ²ªG:



Option Explicit
Sub TEST()
Dim Brr, Crr, Y, R&, C%, i&, N&, TT$, T1$, T2$, Mc%
'¡ô«Å§iÅܼÆ
Set Y = CreateObject("Scripting.Dictionary")
'¡ô¥OYÅܼƬO ¦r¨å
Brr = Range([B1], [A65536].End(xlUp))
'¡ô¥OBrrÅܼƬO ¤Gºû°}¦C,¥HA~BÄæÀx¦s®æ­È±a¤J°}¦C¸Ì
ReDim Crr(1 To UBound(Brr), 1 To 100)
'¡ô«Å§iCrr¬O ¤GºûªÅ°}¦C,Áa¦V½d³ò¦PBrr°}¦C,¾î¦V½d³ò±q1~100
For i = 1 To UBound(Brr)
'¡ô³]¶¶°j°é
   T1 = Brr(i, 1): T2 = Brr(i, 2): TT = T1 & "|" & T2
   '¡ô¥OÅܼƲ±¸Ë°}¦C­È,¥OTTÅܼƬOÂo­«½Æªº²Õ¦X¦r¦ê
   If Y(TT) <> "" Then GoTo i01
   '¡ô¦pªGTTÅܼƦbY¦r¨å¸Ì¤w¸g¦³³okey!´N¸õ¨ìi01¼Ð¥Ü¦ì¸mÄ~Äò°õ¦æ
   If Y(T1) = "" Then
   '¡ô¦pªG¬OAÄæªì¦¸¥X²{ªº¶µ¥Ø?
      N = N + 1
      '¡ô¥ONÅܼƲ֥[1 («ü©w¦¹AÄ涵¥Ø¦bCrr°}¦C¸Ìªº¯Á¤Þ¦C¸¹)
      Y(T1) = N
      '¡ô±N¯Á¤Þ¦C¸¹¥H AÄ涵¥Ø·íkey,¯Ç¤JY¦r¨å¸Ì
      Crr(N, 1) = Brr(i, 1)
      '¡ô¥ý±NAÄ涵¥Ø¼g¤JCrr°}¦C¸Ì
      Y(T1 & "/c") = 1
      '¡ô³o¬O­n°O¿ý¾î¦VÄæ¦ìªºkey,item¬O1 (¦]¬°²Ä1Äæ¤w¸g³Q AÄ涵¥Ø¥Î±¼¤F)
   End If
   R = Y(T1)
   '¡ô¤£ºÞAÄ涵¥Ø¬O¤£¬O­º¦¸¥X²{!
   '¥ORÅܼƸËAÄ涵¥Ø©Ò±aªºitem­È

   C = Y(T1 & "/c")
   '¡ô¥OCÅܼƬO AÄ涵¥Ø©Ò±aªºÄæ¼Æ
   C = C + 1
   '¡ô¥OCÅܼƲ֥[1
   Y(T1 & "/c") = C
   '¡ô¥OAÄ涵¥Ø©Ò±aªºÄæ¼Æ¸Ë·sªºÄæ¼ÆC
   Y(TT) = 1
   '¡ô¥O¦bY¦r¨å¸ÌªºTTÅܼÆkey,item­È§ï¬°1(Åý«á°j°éÂo­«½Æ)
   Crr(R, C) = T2
   '¡ô¥OBÄ涵¥Ø¼g¤JCrr°}¦C¤¤
   If C > Mc Then Mc = C
   '¡ô³oMcÅܼƬO¬°¤F­n°»´úCrr°}¦C©Ò»Ý­nªºÄæ¼Æ
i01: Next
[I1].Resize(N, Mc) = Crr
'¡ô¥OCrr°}¦C­È±q[I1]¶}©l¼g¤JÀx¦s®æ¸Ì
Set Y = Nothing: Erase Brr, Crr
'¡ô¥OÄÀ©ñÅܼÆ
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

        ÀR«ä¦Û¦b : ¹D¼w¬O´£ª@¦Û§Úªº©ú¿O¡A¤£¸Ó¬O¨þ¥¸§O¤HªºÃ@¤l¡C
ªð¦^¦Cªí ¤W¤@¥DÃD