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

[µo°Ý] vbaªº¿z¿ï¥\¯à (¨ú®ø³¡¤À¿z¿ï)

¥»©«³Ì«á¥Ñ jcchiang ©ó 2020-10-29 11:31 ½s¿è

¦^´_ 44# wei9133

1.¨º¬qµ{¦¡§Ú°õ¦æ¨S¦³°ÝÃD(¥u¬O²M°£­p¼Æ¸ê®Æ,·sªºµ{¦¡¤w¤£»Ý­n)
2.¥u­n¬O¥u¦³1¦Cªººû«ù­ì¸ê®Æ
   ²Ä¤G¦C¶}©l,°£³Ó²vÄæ¦ì¼Æ­È²Ö¥[,¨C¦C¦A¥[1(²Ä¤@¦C¤£¥[)
¶È1¦CµL¨ä¥L¬Û¦PªÌ (¸Ó®æ³Ó²v¬° "3")
Á`¦@³Ó4³õ¡A¦X¨Ö«á³Ó²vÄæ¼Ð°O¬° 3³õ
-->1¦Cªººû«ù­ì¸ê®Æ

¶È1¦CµL¨ä¥L¬Û¦PªÌ (¸Ó®æ³Ó²v¬° "ªÅ")
Á`¦@³Ó1³õ¡A¦X¨Ö«á³Ó²vÄæ¼Ð°O¬° ªÅ³õ
-->1¦Cªººû«ù­ì¸ê®Æ

¦@2¦C¬Û¦P ³Ó²v¬° "2","ªÅ"
Á`¦@³Ó4³õ¡A¦X¨Ö«á³Ó²vÄæ¼Ð°O¬° 3³õ
-->2¦C¥H¤W("2"+"(0+1)"=3)

¦@2¦C¬Û¦P ³Ó²v¬° "ªÅ","ªÅ"
Á`¦@³Ó2³õ¡A¦X¨Ö«á³Ó²vÄæ¼Ð°O¬° 1³õ
-->2¦C¥H¤W("0"+"(0+1)"=1)

¦@2¦C¬Û¦P ³Ó²v¬° "2","1"
Á`¦@³Ó5³õ¡A¦X¨Ö«á³Ó²vÄæ¼Ð°O¬° 4³õ
-->2¦C¥H¤W("2"+"(1+1)"=4)

¦@3¦C¬Û¦P ³Ó²v¬° "2","ªÅ","1"
Á`¦@³Ó6³õ¡A¦X¨Ö«á³Ó²vÄæ¼Ð°O¬° 5³õ
-->2¦C¥H¤W("2"+"(0+1)","(1+1)"=5)

¦@4¦C¬Û¦P ³Ó²v¬° "7","ªÅ","3","ªÅ"
Á`¦@³Ó14³õ¡A¦X¨Ö«á³Ó²vÄæ¼Ð°O¬° 13³õ
-->2¦C¥H¤W("7"+"(0+1)"+"(3+1)"+"(0+1)"=13)
¦pªGÁÙ¬O¤£¹ï,½Ð¼g­pºâ¤½¦¡(¥u¼g´X³õ«ÜÃø²z¸Ñ)

Sub ex5()
Dim d As Object, ar As Object, r
Dim i%, AA$, a
Application.ScreenUpdating = False
Set d = CreateObject("Scripting.Dictionary")
Set ar = Sheets("¹ï¾Ô²Î­p").[a1].CurrentRegion
For i = 1 To ar.Rows.Count
   AA = Join(Application.Transpose(Application.Transpose(ar(i, 1).Resize(, 102))), ",") & "," & ar(i, 106) '«Ø¥ß§PÂ_±ø¥ó
   If Not d.exists(AA) Then   '¦r¨å¤º¬dµL¸Ó±ø¥ó
      d(AA) = Application.Transpose(Application.Transpose(ar(i, 1).Resize(, 115)))
   Else
      a = Application.Transpose(Application.Transpose(d(AA)))   '±N¦r¨å¸ê®Æ¨ú¥X
      a(103) = a(103) + ar(i, 103) + 1 '²Ä¤Gµ§¥H¤W³Ó³õ³£¦h¥[1
      For Each r In Array(104, 107, 109, 115) '±N³Æµù,DC,DE,DKÄæ¦ì¸ê®Æ¦X¨Ö
         If a(r) <> "" And ar(i, r) <> "" Then '¦pªG¦r¨å»PÄæ¦ì³£¦³¸ê®Æ,¨Ï¥Î","¬Û³s
            a(r) = a(r) & "," & ar(i, r)
         ElseIf a(r) = "" And ar(i, r) <> "" Then '¦pªG¦r¨å¸ê®Æ¬°ªÅ¥Õ,Äæ¦ì¬O¦³¸ê®Æªº,¨Ï¥ÎÄæ¦ì¸ê®Æ
            a(r) = ar(i, r)
         End If
      Next
      d(AA) = a   '±N¸ê®Æ©ñ¦^¦r¨å
   End If
Next
With Sheets(2)  '¦b²Ä¤G­ÓSheet¶ñ¤J¸ê®Æ
.[a1].CurrentRegion.Clear '²M°£Sheet¸ê®Æ
.[a1].Resize(d.Count, UBound(a)) = Application.Transpose(Application.Transpose(d.items)) '±N¦r¨å¸ê®Æ¦C¥X
End With
Set d = Nothing
Application.ScreenUpdating = True
End Sub

TOP

¦^´_  wei9133

1.¸ê®Æ¦ì¸m©ñ¸m²Ä¤G­Ósheet,½Ð¦Û¦æ­×§ï©ñ¸m¦ì¸m
2.³Ó³õ­pºâ¤è¦¡
-->¥u¦³1µ§¸ê®Æ,³Ó³õ³£ ...
jcchiang µoªí©ó 2020-10-22 10:24



    §A¦n¡A³o­Ó°õ¦æ·|µo¥Í¿ù»~



³Ó³õ­pºâ¤è¦¡
-->¥u¦³1µ§¸ê®Æ,³Ó³õ³£¤£ÅÜ°Ê
-->2µ§¥H¤W¸ê®Æ,©Ò¦³ªº"ªÅ"³£ºâ¼W¥[1³õ,¦³­Èªºª½±µ²Ö¥[

¦³­ÈªºÀ³¸Ó¬O¸Ó­È+1
(¦]¬°¸Ó¦C¥»¨­´N¬O1)
¥i¥H¬Ý¬Ý#41ªºªTÁ|

        §A­Ìªº²z¸ÑÀ³¸Ó³£¬O¸Ó¦C¤£­p¼Æ¡A³Ó³õ´N¬OÁ`³Ó¼Æ
        ¦ý³o¼Ë´N¤£¥i¯à¥X²{³Ó²v¬°ªÅªº®æ¤l¤F
        ¦]¬°¨C®æ¦Ü¤ÖÀ³¸Ó³£­n¬O1¡C


        ¤£¹L³o­Ó°ÝÃD¥i¥H³z¹L§Ú§ïÅܲέp¤è¦¡¸Ñ¨M¡A¤£¹L¤W­±·|µo¥Í¿ù»~ªº³¡¤À­n¥ý¸Ñ¨M

TOP

¦^´_  wei9133

¦³ªÅÀ°§Ú¬Ý¤@¤U ¬O¤£¬O³o¼Ëªºµ²ªG ÁÂÁÂ

javascript:;
°a¤ªºµ µoªí©ó 2020-10-25 01:20



        §A¦n¡AÀ³¸Ó¤£¹ï
    °õ¦æ§¹¥uŤ@³õªº³£³Q§R±¼¤F
    §AÀ°§Ú¬Ý¤@¤U#41§A¬O§_¯à°÷²z¸Ñ
       
        ¦X¨Ö«e¨C¦C³£¤w¸gµø¬°1¤F(³Ó²vµL­Èªºª¬ªp)
       
        À³¸Ó³o¼ËÁ¿¡A³Ó²vµL­È¬°1¡A¦³­È´N¥[¤W¥h§A§â³Ó²v¨º®æ¤ºªº¼Æ¦r¤@«ß+1
        ³Ì«á§âÁ`¼Æ¥[°_¨Ó-1
        (-1¬O¦]¬°¸Ó¦C¦Û¤v´N¬O1)
       

        ¥Ø«e¦³3¦C¤@¼Ë (³o¸Ì¤w¸g1~102¸ò106³]©w¬°¤@¼Ë¤F)
        ³Ó²v®æ¤À§O¬°
          
        ²Ä¤@¦C³Ó²v"ªÅ" = ³o¦CÁ`¦@³Ó1³õ
        ²Ä¤G¦C³Ó²v"2"  = ³o¦CÁ`¦@³Ó3³õ
        ²Ä¤T¦C³Ó²v"ªÅ" = ³o¦CÁ`¦@³Ó1³õ
       
    ³o¤T¦C­n¦X¨Ö¡A©Ò¥HÁ`¦@¬OŤF5³õ
        ¯d¤U¤@¦C¡A³Ó³õ¶ñ¤J4
        (ÁÙ¦³¤@³õ´N¬O¯d¤Uªº¨º¤@¦C)
       
        ;======================================

        ¥t¤@­Ó±¡ªp
        ¥þ³¡§ä§¹´N¥u¦³³o¤@¦C¡AµL¥t¤@¦Cªø±o¤@¼Ëªº
        ©Ò¥HÅܦ¨
       
        ²Ä¤@¦C³Ó²v"ªÅ" = ³o¦CÁ`¦@³Ó1³õ
       
        ¨S±o¦X¨Ö
        ¯d¤U¤@¦C¡A³Ó³õ¤£¶ñ
        (¦]¬°¥»´NµL­È)
       
        ;======================================

        ¥þ³¡§ä§¹´N¥u¦³³o¤@¦C¡AµL¥t¤@¦Cªø±o¤@¼Ëªº
        ©Ò¥HÅܦ¨
       
        ²Ä¤@¦C³Ó²v"3" = ³o¦CÁ`¦@³Ó4³õ
       
        ¨S±o¦X¨Ö
        ¯d¤U¤@¦C¡A³Ó³õ¶ñ3
        (¯d¤U³o¤@¦C¬°1¡A³Ó³õ¼g3)
       
        ¨ä¹ê³Ó³õÀ³¸Ó²z¸Ñ¬°¦hĹªº¦¸¼Æ
       
       
        §A­Ìªº²z¸ÑÀ³¸Ó³£¬O¸Ó¦C¤£­p¼Æ¡A³Ó³õ´N¬OÁ`³Ó¼Æ
        ¦ý³o¼Ë´N¤£¥i¯à¥X²{³Ó²v¬°ªÅªº®æ¤l¤F
        ¦]¬°¨C®æ¦Ü¤ÖÀ³¸Ó³£­n¬O1¡C

        ¦Ó§Ú¦b¥´¸ê®Æªº®É­Ô¤w¸g§â¸Ó¦Cµø¬°1¤F
        ¥X²{¸Ó¦C´N¬O³Ó1³õ¡A¦³¦AŦA+1¦b³Ó³õ¤W­±
        ©Ò¥H¨C¦Cªº³Ó³õ¸Ó®æªº¼Æ¦r¼Æ¨ä¹ê¥¼¥]§t¦Û¤v¥»¨­¡A¦X¨Öªº®É­Ô´N­n§â¥L¥[¤W¥h

TOP

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


      
³oªº½T¬O¦P¤@¹ï¾Ô¡A§Ú¥Ø«e¨S¿ìªk²Î­p¨ì³o»ò²Ó¡A©Ò¥H¤~·|¦U¦Û¶ñ¤W³Ó¸ò±Ñ³õ
        ¦]¬°¦³¤À§Ú¥h¥´¸ò³Q¥´ªºª¬ªp¡A§Ú´N¬O²Î­pŸò¿é¦Ó¤w
        ¤@­Ó¤@­ÓºI¹Ï¡AµM«á§â¸ê®Æ¥´¶iexcel¸Ì
       
        ¦]¬°­n¥´ªº®É­Ô·|¥Îexcel¥h¿z¿ï¼Ä¹ï¤è±ø¥ó¡AµM«á¥h¥´¡A¥´Ä¹¦b³Ó³õ+1¡A¥´¿é¦b±Ñ³õ+1
        µM«á±Ñ³õ¦h¤F¦A¥Î¿z¿ï¥h§ä¬Û¹ïªº³¡¤À¡A§â¨âÃ䪺¼Æ¦r´«¹L¨Ó
       
        °ò¥»¤W³o­Ó¬ö¿ýªíµÛ­«¦b¥´Ä¹ªº³¡¤À¡A¤ñ¸û³Â·Ðªº³¡¤À¦b©ó¼Ä¹ï¤è¦³¨Ç¬O½Òª÷­^¶¯
        ©Ò¥H·|¥X²{¶È¦³´X³õ³Ó²v¦ý±Ñ²v«Ü°ªªº¦C¡A³o­Ó´N¨S±o¤ÏÂà¤F

       
        ¦^¨ì¥DÃD
        ³o±iªí¬O®³¨Ó°Ñ¦Ò¼Ä¹ï¤è¥X°}®É§Ú­n¥X¬Æ»ò²Õ¦X¤~¦³¸û°ª³Ó²v
       
        ²Õ¦X1--a/b/d/f/h-¤HÃþ -- ³Ó5±Ñ3
        ²Õ¦X2--b/d/e/f/g-¤HÃþ -- ³Ó3±Ñ5
        ²z½×¤W¨ÓÁ¿¡A­Y§ð¦uÂù¤è²Õ¦X¤¤¨S¦³§t§Ú¨S¦³ªº½Òª÷­^¶¯¡A§Ú·|¯d¦s³Ó²v°ªªº¨º²Õ
        ¤]´N¬O²Õ¦X1¡AµM«á¸I¨ì¹ï¤è¥X°}²Õ¦X2´N®³²Õ¦X1¥h¥´
       
        ¦ý¦]¬°¦³½Òª÷­^¶¯¦s¦b³o­Ó´N·|½ÆÂø«Ü¦h
        ¦]¬°§Ú¨S¦³¨º­Ó­^¶¯¡A´N¥u¯àµn°O²Õ¦X2
        ÁöµM±Ñ³õ¤ñ³Ó³õ°ª¡A¦ý¬O§Ú¥u¦³²Õ¦X2¥i¥H¥X
       
        ©Ò¥H¥Ø«e¥u¯à³o¼Ëµn°O¦Ó¤w

TOP

¦^´_  wei9133

#33
¦³2³õ¤@¼Ë(³Ó²vÄ欰"ªÅ","ªÅ")¦X¨Ö³Ó²v¬°1
¥u¦³1³õ(³Ó²vÄ欰"ªÅ")³Ó²v¬°"ªÅ"

´X ...
jcchiang µoªí©ó 2020-10-22 08:22



   
#33
¦³2³õ¤@¼Ë(³Ó²vÄ欰"ªÅ","ªÅ")¦X¨Ö³Ó²v¬°1
¥u¦³1³õ(³Ó²vÄ欰"ªÅ")³Ó²v¬°"ªÅ"

´XºØª¬ªp¦p¦ó­pºâ
2³õ(³Ó²v¬°"3","ªÅ")¦X¨Ö³Ó²v??(¬O§_¬°4)
3³õ(³Ó²v¬°"3","ªÅ","ªÅ")¦X¨Ö³Ó²v??(¬O§_¬°4)
3³õ(³Ó²v¬°"ªÅ","ªÅ","ªÅ")¦X¨Ö³Ó²v??(¬O§_¬°1)
3³õ(³Ó²v¬°"3","1","ªÅ")¦X¨Ö³Ó²v??(¬O§_¬°5)
4³õ(³Ó²v¬°"ªÅ","3","1","ªÅ")¦X¨Ö³Ó²v??(¬O§_¬°5)
¥u¦³¤@³õ¬O§_³Ó²vÄæ¦ì³£¤£ÅÜ
¦h³õªº¥u­n³Ó²v¬°ªÅªº¤£ºÞ´X³õ³£¥uºâ1³õ³Ó³õ,¨ä¾l³Ó²vÄ榳­Èªºª½±µ²Ö¥[­È

§A¦n¡A©êºp²{¦b¤~¦^´_

2³õ(³Ó²v¬°"3","ªÅ")¦X¨Ö³Ó²v??  
Á`¦@³Ó5³õ¡A¦X¨Ö«á³Ó²vÄæ¼Ð°O¬° 4³õ

3³õ(³Ó²v¬°"3","ªÅ","ªÅ")¦X¨Ö³Ó²v??  
Á`¦@³Ó6³õ¡A¦X¨Ö«á³Ó²vÄæ¼Ð°O¬° 5³õ

3³õ(³Ó²v¬°"ªÅ","ªÅ","ªÅ")¦X¨Ö³Ó²v??  
Á`¦@³Ó3³õ¡A¦X¨Ö«á³Ó²vÄæ¼Ð°O¬° 2³õ

3³õ(³Ó²v¬°"3","1","ªÅ")¦X¨Ö³Ó²v??     
Á`¦@³Ó7³õ¡A¦X¨Ö«á³Ó²vÄæ¼Ð°O¬° 6³õ

4³õ(³Ó²v¬°"ªÅ","3","1","ªÅ")¦X¨Ö³Ó²v??
Á`¦@³Ó7³õ¡A¦X¨Ö«á³Ó²vÄæ¼Ð°O¬° 6³õ

¥H¤U°l¥[¡A¬Ý¯à§_²z¸Ñ

¶È1¦CµL¨ä¥L¬Û¦PªÌ (¸Ó®æ³Ó²v¬° "3")
Á`¦@³Ó4³õ¡A¦X¨Ö«á³Ó²vÄæ¼Ð°O¬° 3³õ

¶È1¦CµL¨ä¥L¬Û¦PªÌ (¸Ó®æ³Ó²v¬° "ªÅ")
Á`¦@³Ó1³õ¡A¦X¨Ö«á³Ó²vÄæ¼Ð°O¬° ªÅ³õ

¦@2¦C¬Û¦P ³Ó²v¬° "2","ªÅ"
Á`¦@³Ó4³õ¡A¦X¨Ö«á³Ó²vÄæ¼Ð°O¬° 3³õ

¦@2¦C¬Û¦P ³Ó²v¬° "ªÅ","ªÅ"
Á`¦@³Ó2³õ¡A¦X¨Ö«á³Ó²vÄæ¼Ð°O¬° 1³õ

¦@2¦C¬Û¦P ³Ó²v¬° "2","1"
Á`¦@³Ó5³õ¡A¦X¨Ö«á³Ó²vÄæ¼Ð°O¬° 4³õ

¦@3¦C¬Û¦P ³Ó²v¬° "2","ªÅ","1"
Á`¦@³Ó6³õ¡A¦X¨Ö«á³Ó²vÄæ¼Ð°O¬° 5³õ

¦@4¦C¬Û¦P ³Ó²v¬° "7","ªÅ","3","ªÅ"
Á`¦@³Ó14³õ¡A¦X¨Ö«á³Ó²vÄæ¼Ð°O¬° 13³õ

¥H¤W³£¬O¦X¨Ö§¹«á¶È¯d¤@¦C

¥u¦³¤@³õ¬O§_³Ó²vÄæ¦ì³£¤£ÅÜ
¨S¦³2­Ó¬Û¦Pªº¦C³Ó²vÄ椣ÅܵL»~

¦h³õªº¥u­n³Ó²v¬°ªÅªº¤£ºÞ´X³õ³£¥uºâ1³õ³Ó³õ,¨ä¾l³Ó²vÄ榳­Èªºª½±µ²Ö¥[­È

µn°O¹Lªº¤@¦C´N¬O¤@¡A«á­±³Ó²vÄ榳­È´N¥Nªíµn°Oªº·í¤U¦³2­Ó¤@¼Ëªº²Õ¦XÀò³Ó
¦]¬°µn°O¤£¨£±o¬O¦P¤@¤Ñ¡A©Ò¥H¤~·|¥X²{
¦P¼Ëªº¦C¦ý³Ó²v¤£¦Pªºª¬ªp¡A³o­Ó®É­Ô´N»Ý­n¦X¨Ö
¥ý«e´N¬O³£¤â¤u¦X¨Ö

TOP

¥»©«³Ì«á¥Ñ °a¤ªºµ ©ó 2020-10-25 10:49 ½s¿è

¦^´_ 34# wei9133

·Pı±Ñ§½ ©Ç©Çªº ©Ò¥H§ï¤F¤@¤U ¦³ªÅÀ°§Ú¬Ý¤@¤U ·PÁ ¶]ªº³t«×ºC¤F¤@¨Ç ¤£ª¾¦p¦ó¥[§Ö³t«×.....
  1. Public Sub ½m²ß1025()
  2. Application.ScreenUpdating = False
  3. Sheets(1).Select
  4. Sheets(2).[a1].CurrentRegion.Clear
  5. Dim Arr, D, xD, xD1, x&, y&, k&, T1$, T2$, T3$, T4$
  6. Set xD = CreateObject("Scripting.Dictionary")
  7. Set xD1 = CreateObject("Scripting.Dictionary")
  8. Arr = Range(Cells(Rows.Count, 1).End(xlUp), Cells(1, 115))
  9. For x = 2 To UBound(Arr, 1)
  10.     T1 = ""
  11.     For y = 1 To 51
  12.         T1 = T1 & Arr(x, y)
  13.         If Arr(x, y) = "" Then T1 = T1 & "-"
  14.     Next y
  15.     T3 = ""
  16.     For y = 52 To 102
  17.         T3 = T3 & Arr(x, y)
  18.         If Arr(x, y) = "" Then T3 = T3 & "-"
  19.     Next y
  20.     If T1 = T3 Then
  21.        T1 = T1 & T3 & Arr(x, 106)
  22.        T3 = ""
  23.         If Arr(x, 103) = "" Then
  24.            Arr(x, 103) = 1
  25.            xD(T1) = xD(T1) + Arr(x, 103)
  26.         ElseIf Arr(x, 103) <> "" Then
  27.            xD(T1) = xD(T1) + Arr(x, 103)
  28.         End If
  29.         xD1(T1) = xD1(T1) + Arr(x, 105)
  30.     End If
  31. Next x
  32. T1 = "": T3 = ""
  33. For Each D In xD
  34.     For x = UBound(Arr, 1) To 2 Step -1
  35.         T2 = ""
  36.         For y = 1 To 51
  37.             T2 = T2 & Arr(x, y)
  38.             If Arr(x, y) = "" Then T2 = T2 & "-"
  39.         Next y
  40.         T4 = ""
  41.         For y = 52 To 102
  42.             T4 = T4 & Arr(x, y)
  43.             If Arr(x, y) = "" Then T4 = T4 & "-"
  44.         Next y
  45.         If T2 = T4 Then
  46.             T2 = T2 & T4 & Arr(x, 106)
  47.             T4 = ""
  48.             If D = T2 Then
  49.                 Arr(x, 103) = xD(D)
  50.                 Arr(x, 105) = xD1(D)
  51.             End If
  52.         End If
  53.     Next x
  54. Next D
  55. T2 = "": T4 = "": D = "": k = 1
  56. For x = 2 To UBound(Arr, 1)
  57.     If Arr(x, 103) <> "" Or Arr(x, 105) <> "" Then
  58.         If Arr(x, 107) <> "" Or Arr(x, 109) <> "" _
  59.         Or Arr(x, 115) <> "" Or Arr(x, 104) <> "" Then
  60.             k = k + 1
  61.         End If
  62.         For y = 1 To UBound(Arr, 2)
  63.             If Arr(x, 107) <> "" Or Arr(x, 109) <> "" _
  64.             Or Arr(x, 115) <> "" Or Arr(x, 104) <> "" Then
  65.                 Arr(k, y) = Arr(x, y)
  66.             End If
  67.         Next y
  68.     End If
  69. Next x
  70. Set xD = Nothing
  71. Set xD1 = Nothing
  72. Sheets(2).Range("A1").Resize(k, UBound(Arr, 2)) = ""
  73. Sheets(2).Range("A1").Resize(k, UBound(Arr, 2)) = Arr
  74. Erase Arr
  75. Sheets(2).Select
  76. Application.ScreenUpdating = True
  77. End Sub
½Æ»s¥N½X

TOP

¦^´_ 34# wei9133

¦³ªÅÀ°§Ú¬Ý¤@¤U ¬O¤£¬O³o¼Ëªºµ²ªG ÁÂÁÂ

javascript:;

¹ï¾Ô²Î­p -1025.rar (699.95 KB)

TOP

¥»©«³Ì«á¥Ñ °a¤ªºµ ©ó 2020-10-24 21:11 ½s¿è

¦^´_ 34# wei9133

½Ð°Ý§A­nªºµ²ªG¬O¤£¬O³o¼Ë
¥ý¥ª¥k¤ñ¹ï ­Y¬O 1~51  ¸ò 52~102 ¬Û¦P®É + ¬P¶H106 ¦¹®É(³Ó²v =  "" ©Î ±Ñ§½ = ""  ¥»¨­´N¬O =1 ©ÎµÛ =-1 ?)  ·í§@´M§ä¤ñ¹ïªº¥Ø¼Ð  
¦A´M§ä¤ñ¹ï¤W¤U 1~102 + ¬P¶H106 ­Y¬Û¦P®É  ¦b¬Ý 103³Ó²v  ¸ò  105±Ñ§½ ¶i¦æ²Ö¥[
²Ö¥[«áªº¼Æ­È­n¦b ¦X¨Ö¸Ó¦Cªº¶¶§Ç¤W
¦X¨Ö¸Ó¦Cªº¶¶§Ç¬O   ¥ý107 A  ­Y =""  ´N¦X¨Ö¦b 109  X   ­Y ="" ´N¦X¨Ö¦b   115¼È¦s   ­Y =""  ´N¦X¨Ö¦b  104³Æµù
ÁÙ¬O»¡ ´N¹³ jcchiang «e½ú ¸ò ­ã´£¤j¤j ©Ò»¡ªº ³o¼Ë½ÆÂøªº²Õ¦Xºâªk?
©ÎµÛ¯à§_²³æ©úÁA´N¦n §Ú¹ê¦b¤£¤Ó©ú¥Õ©êºp...¤p§Ì¼Æ¾Ç¤£¦n

TOP

²Õ¦X1--a/b/d/f/h-¤HÃþ(³Ó¤è)   ²Õ¦X2--b/d/e/f/g-¤HÃþ(±Ñ¤è) --- ¦@¥X²{5¦¸
²Õ¦X2--b/d/e/f/g-¤HÃþ(³Ó¤è)   ²Õ¦X1--a/b/d/f/h-¤HÃþ(±Ñ¤è) --- ¦@¥X²{3¦¸
ÁöµM¥ª¥k¹ï½Õ, ¦ýÀ³ºâ¦P¤@²Õ¦X¹ï¾Ô§a!

²Õ¦X1--a/b/d/f/h-¤HÃþ -- ³Ó5±Ñ3
²Õ¦X2--b/d/e/f/g-¤HÃþ -- ³Ó3±Ñ5

³o³Ó±Ñ²v¦p¦ó­pºâ???

TOP

¦^´_ 33# wei9133

1.¸ê®Æ¦ì¸m©ñ¸m²Ä¤G­Ósheet,½Ð¦Û¦æ­×§ï©ñ¸m¦ì¸m
2.³Ó³õ­pºâ¤è¦¡
-->¥u¦³1µ§¸ê®Æ,³Ó³õ³£¤£ÅÜ°Ê
-->2µ§¥H¤W¸ê®Æ,©Ò¦³ªº"ªÅ"³£ºâ¼W¥[1³õ,¦³­Èªºª½±µ²Ö¥[

Sub ex4()
Dim d As Object, ar As Object, r
Dim i%, AA$, a
Application.ScreenUpdating = False
Set d = CreateObject("Scripting.Dictionary")
Set ar = Sheets("¹ï¾Ô²Î­p").[a1].CurrentRegion

For i = 1 To ar.Rows.Count
   AA = Join(Application.Transpose(Application.Transpose(ar(i, 1).Resize(, 102))), ",") & "," & ar(i, 106) '«Ø¥ß§PÂ_±ø¥ó
   If Not d.exists(AA) Then   '¦r¨å¤º¬dµL¸Ó±ø¥ó
      a = Application.Transpose(Application.Transpose(ar(i, 1).Resize(, 115)))
      ReDim Preserve a(1 To UBound(a) + 2)
      If a(103) = "" Then a(UBound(a) - 1) = 1 '¬ö¿ý³Ó³õªÅ¥Õ¼Æ
      a(UBound(a)) = 1 '¬ö¿ýµ§¼Æ
      d(AA) = a '±N¸ê®Æ©ñ¦^¦r¨å
   Else
      a = Application.Transpose(Application.Transpose(d(AA)))   '±N¦r¨å¸ê®Æ¨ú¥X
      If ar(i, 103) = "" Then a(UBound(a) - 1) = a(UBound(a) - 1) + 1 Else a(103) = a(103) + ar(i, 103) '³Ó³õªÅ¥Õ¬ö¿ý²Ö¥[1,¤£¬OªÅ¥Õ«h±NÄæ¦ì­È¬Û¥[
      a(UBound(a)) = a(UBound(a)) + 1 ''¬ö¿ýµ§¼Æ+1
      a(105) = a(105) + ar(i, 105) '±Ñ§½²Ö¥[
      For Each r In Array(104, 107, 109, 115) '±N³Æµù,DC,DE,DKÄæ¦ì¸ê®Æ¦X¨Ö
         If a(r) <> "" And ar(i, r) <> "" Then '¦pªG¦r¨å»PÄæ¦ì³£¦³¸ê®Æ,¨Ï¥Î","¬Û³s
            a(r) = a(r) & "," & ar(i, r)
         ElseIf a(r) = "" And ar(i, r) <> "" Then '¦pªG¦r¨å¸ê®Æ¬°ªÅ¥Õ,Äæ¦ì¬O¦³¸ê®Æªº,¨Ï¥ÎÄæ¦ì¸ê®Æ
            a(r) = ar(i, r)
         End If
      Next
      d(AA) = a   '±N¸ê®Æ©ñ¦^¦r¨å
   End If
Next
With Sheets(2)  '¦b²Ä¤G­ÓSheet¶ñ¤J¸ê®Æ
.[a1].CurrentRegion.Clear '²M°£Sheet¸ê®Æ
.[a1].Resize(d.Count, UBound(a)) = Application.Transpose(Application.Transpose(d.items)) '±N¦r¨å¸ê®Æ¦C¥X
For Each r In .Range(.[cy2], .[cy65535].End(3))
   If r.Offset(, 14) > 1 And r.Offset(, 13) > 0 Then r.Value = r.Value + 1 '2µ§¸ê®Æ¥H¤W¥B¦³³Ó³õ¬°"ªÅ"ªº³Ó³õ+1
Next
i = .[a1].CurrentRegion.Columns.Count
.Range(Cells(1, i - 1), Cells(65535, i).End(3)).Clear '²M°£ªÅ¥Õ&¸ê®Æ­pºâµ§¼Æ
End With
Set d = Nothing
Application.ScreenUpdating = True
End Sub

TOP

        ÀR«ä¦Û¦b : ¡i¥Í©R¦b©I§l¶¡¡j¦òªû»¡¡G¡u¥Í©R¦b©I§l¶¡¡C¡v¤HµLªkºÞ¦í¦Û¤vªº¥Í©R¡A§óµLªk¾×¦í¦º´Á¡AÅý¦Û¤v¥Ã¦í¤H¶¡¡C¬JµM¥Í©R¥h¨Ó³o»òµL±`¡A§Ú­Ì§óÀ³¸Ó¦n¦n¦a·R±¤¥¦¡B§Q¥Î¥¦¡B¥R¹ê¥¦¡AÅý³oµL±`¡BÄ_¶Qªº¥Í©R¡A´²µo¥¦¯uµ½¬üªº¥ú½÷¡A¬M·Ó¥X¥Í©R¯u¥¿ªº»ù­È¡C
ªð¦^¦Cªí ¤W¤@¥DÃD