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

[µo°Ý] ½Ð±Ð¸ê®Æ§ì¨ú¨Ã¥BÄæ¦CÂà´«§e²{

[µo°Ý] ½Ð±Ð¸ê®Æ§ì¨ú¨Ã¥BÄæ¦CÂà´«§e²{

½Ð°Ý¦U¦ì«e½ú °ª¤H

­n±N¤w±Æ§Çªº¨âÄæ¸ê®Æ(¦pªþ¥ó datatest01.rar (8.54 KB) )
name ¦³­«½Æ

Sheet1
name     phone
A            0911123456
A            0911123457
B            0911123458
B            0911123459
B            0911123460
C            0911123461
C            0911123462

¦bSheet2¤¤  Åܦ¨name«á­±ªºphone¦b¦P¤@¦C¤¤Åã¥Ü (¤ñ¹ï¸ê®Æ§ì¨ú«á Äæ¦CÂà´«§e²{¥X¨Ó)

Sheet2
name     phone
A           0911123456           0911123457
B           0911123458           0911123459           0911123460
C           0911123461           0911123462

¤p§Ì¦b150µ§¸ê®Æ¤¤ ¸Õ¤FIF  index  match  COUNTIF...¥Î¤F¤@¾ã¤Ñ³£µLªk¦¨¥\
¤gªk·Ò¿ûÁÙ¤ñ¼g¥X¨Óªº¨ç¼Æ»yªk§Ö.........

½Ð°Ý¦U¦ì«e½ú °ª¤â
³o¼Ëªº±¡ªp¥Î¤°»ò¨ç¼Æ¤~¾A¦X¡H»yªk¸Ó«ç»ò¼g©O¡H

ªþ¥ó datatest01.rar (8.54 KB)
·PÁ½ç±Ð
Orz

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

°õ¦æµ²ªG:



Option Explicit
Sub TEST()
Dim Brr, Crr, V, Z, i&, R&, C%, Y&, X%, T$, T1$, T2$
Set Z = CreateObject("Scripting.Dictionary")
Brr = Range([Sheet1!B1], [Sheet1!A65536].End(3))
ReDim Crr(1 To UBound(Brr), 1 To 200)
For i = 2 To UBound(Brr)
   If i = 2 Then: Crr(1, 1) = Brr(1, 1) & " \ " & Brr(1, 2): Y = 1
   T1 = Brr(i, 1): T2 = Brr(i, 2): T = T1 & "|" & T2
   If Z(T) = 1 Then GoTo i01
   R = Z(T1): C = Z(T1 & "/c"): C = C + 1:  Z(T1 & "/c") = C
   If R = 0 Then Y = Y + 1: Crr(Y, 1) = T1: Z(T1) = Y: R = Y
   Crr(R, C + 1) = T2: Z(T) = 1
   If X < C Then X = C: Crr(1, C + 1) = C
i01: Next
Sheets("Sheet2").UsedRange.Clear
Sheets("Sheet2").[A1].Resize(Y, X + 1) = Crr
Set Z = Nothing: Erase Brr, Crr
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

http://blog.xuite.net/hcm19522/twblog/346436199

TOP

­ì¨Ó¬O³o¼Ë¡AÁöµM¨S¤H¦^µª¡A¦ý¤À¨É¤@¤U
http://isvincent.pixnet.net/blog/post/38734269

TOP

½Ð°Ý¦³«e½ú¯à«üÂI°g¬z¶Ü¡H

TOP

        ÀR«ä¦Û¦b : ¡i°µ¤Hªº¶}©l¡j¨C¤@¤Ñ³£¬O¬G¤Hªº¶}©l¡A¨C¤@­Ó®É¨è³£¬O¦Û¤vªºÄµ±§¡C
ªð¦^¦Cªí ¤W¤@¥DÃD