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

[µo°Ý] ¨Ì«ü©w°Ï¶¡¤é´Á¡B±b¸¹ ¶ñ¤J¸ê®Æ

¦^´_ 13# °a¤ªºµ

½Ð°Ý§Ú¬d¤FCurrentRegion¬O·í«e°Ï°ìªº·N«ä,
¨ºArr = [»¡©ú!I2].CurrentRegion
¬O«ü±qI2¨ì­þ­ÓÀx¦s®æ¬°¤î?

TOP

¦^´_ 12# PJChen

Sub ¹w¬ù§ó·s_2()
Application.ScreenUpdating = False 'Ãö³¬§ó·sµe­±

    '§â¤u§@ªíªº©Ò¦³¤º®e©ñ¨ì°}¦C
    Arr = [»¡©ú!I2].CurrentRegion
    Brr = [¹w¬ù!A1].CurrentRegion

    For X = 2 To UBound(Arr) '¦b°}¦C¸Ìªº²Ä2¦C¶}©l¨ì³Ì«á¤@¦C
        A = Arr(X, 1) & "-" & Arr(X, 4) '»¡©ú¤å¦r ±b¸¹¦êÁp¤é´Á
        For Y = X To UBound(Brr) '¦b°}¦C¸Ìªº²Ä2¦C¶}©l¨ì³Ì«á¤@¦C
            B = Brr(Y, 2) & "-" & Brr(Y, 1) '¹w¬ù¤å¦r ±b¸¹¦êÁp¤é´Á
            If A = B And Brr(Y, 3) = "" Then K = 0 '¦pªG»¡©ú¤å¦r»P¹w¬ù¤å¦r¬Û¦P ¥B¹w¬ùX¦C¦ìªº²Ä3Äæ¦ì¨S¦³¤º®e K´Nµ¥©ó0 ªí¥Ü¨S¦³³Q¤ñ¹ï¹L
            If A = B And Arr(X, 4) <> "" And K <> 1 Then '¦pªG»¡©ú¤å¦rªº»P¹w¬ù¤å¦r¬Û¦P ¥B»¡©úX¦C¦ìªº²Ä4Äæ¦ì¦³¤º®e ¥BK¤£µ¥©ó1 ªí¥Ü¨S¦³³Q¤ñ¹ï¹L
                K = 1 'ªí¥Ü¤w¸g³Q¤ñ¹ï¹L
                Cells(Y, 3) = Arr(X, 7) '§â»¡©úªº¹w¬ùªO¼Æ©ñ¨ì¹w¬ù¤u§@ªíªº³æ¶µ¨úªOÄæ¦ì
                Cells(Y, 7) = "#0000" & Arr(X, 5) '§â»¡©úªº "#0000"¦êÁp¨úªO½s¸¹ ©ñ¨ì¹w¬ù¤u§@ªíªº¨úªO½s¸¹Äæ¦ì
            Exit For '¸õ¨ì¤U¤@­Ó°j°é
            End If
        Next Y
    Next X
    'D:FÄ檺¤½¦¡­È¤Æ ¬O¦]¬°  Brr = [¹w¬ù!A1].CurrentRegion ªºÃö«Y ©Ò¦³¤º®e©ñ¨ì°}¦C ©Î§ï¦¨¯S©w¦ì¸m
'[¹w¬ù!A1].Resize(UBound(Brr, 1), UBound(Brr, 2)) = Brr ¦]¬°¨S¦³¦b°}¦C¸Ì¤ñ¹ï©Ò¥H¤£»Ý­n
Brr«üªº¬O¹w¬ù¤u§@ªí¤ñ¹ï«áªº¤º®e
¨ä¹ê¥Î¦r¨å¤èªk·|§ó¦n ¦ý¤p§ÌÁÙ¦b¾Ç²ß¤¤¤£¤Ó²z¸Ñ...¦³ªÅÁÙ¬O·|¨Ó¬Ý¬Ý¤j¤j­Ì«ç»ò¼g.¶¶«K¾Ç²ß^^"
Application.ScreenUpdating = True '¶}±Ò§ó·sµe­±
End Sub

TOP

¦^´_ 11# °a¤ªºµ

¯u·PÁ¡I°õ¦æ¨S°ÝÃD¤F
½Ð°Ý­ì¨Óªºµ{¦¡,¤£»Ý­n¤F¶Ü? [¹w¬ù!A1].Resize(UBound(Brr, 1), UBound(Brr, 2)) = Brr
2 To UBound(Arr)...UBound(Arr)«e­±ªº¼Æ¦r¥Nªí¤°»ò?§Ú±`¬Ý¨ìµ{¦¡«e¦³¤£¦P¼Æ¦r,¦ý¤£²z¸Ñ¥Îªk¡I
¥i¥Hªº¸Ü¯à§_À°¦£¸Ñ»¡±z¼gªºµ{¦¡¡H

TOP

¦^´_ 10# PJChen

§â°}¦C§ï¦¨ CELLS À³¸Ó¥i¥H ¦³ªÅ¦A¸Õ¸Õ¬Ý¦æ¤£¦æ ·PÁÂ
  1. Sub ¹w¬ù§ó·s_2()
  2. Application.ScreenUpdating = False
  3.     Arr = [»¡©ú!I2].CurrentRegion
  4.     Brr = [¹w¬ù!A1].CurrentRegion

  5.     For X = 2 To UBound(Arr)
  6.         A = Arr(X, 1) & "-" & Arr(X, 4)
  7.         For Y = X To UBound(Brr)
  8.             B = Brr(Y, 2) & "-" & Brr(Y, 1)
  9.             If A = B And Brr(Y, 3) = "" Then K = 0
  10.             If A = B And Arr(X, 4) <> "" And K <> 1 Then
  11.                 K = 1
  12.                 Cells(Y, 3) = Arr(X, 7)
  13.                 Cells(Y, 7) = "#0000" & Arr(X, 5)
  14.             Exit For
  15.             End If
  16.         Next Y
  17.     Next X

  18. Application.ScreenUpdating = True
  19. End Sub
½Æ»s¥N½X

TOP

¦^´_ 8# °a¤ªºµ
±z¦n,
µ{¦¡¦b¹ê§@®É,µo²{¤F°ÝÃD:°õ¦æµ{¦¡«á,·|±ND:FÄ檺¤½¦¡­È¤Æ,¥B¤£ÄÝ©ó³o­Ó°Ï¶¡ªº¤]³£­È¤Æ¤F,
½Ð°Ý­n¦p¦ó­×§ïµ{¦¡,ÅýD:FÄ椣¨üµ{¦¡¼vÅT,«O«ù­ì¼Ë(¦³¤½¦¡«h«O¯d)¡H
¹w¬ù¨úªO.rar (24.19 KB)

TOP

¦^´_ 8# °a¤ªºµ

·PÁ¡I
³o­Óµ{¦¡OK¤F

TOP

¦^´_ 7# PJChen

¦³ªÅ¦A¸Õ¸Õ¬Ý³o¼Ë¦æ¤£¦æ  ·PÁÂ
  1. Public Sub ¸ó¤u§@ªí¤ñ¹ï½m²ß()

  2.     Arr = [»¡©ú!I2].CurrentRegion
  3.     Brr = [¹w¬ù!A1].CurrentRegion

  4.     For X = 2 To UBound(Arr)
  5.         A = Arr(X, 1) & "-" & Arr(X, 4)
  6.         For Y = X To UBound(Brr)
  7.             B = Brr(Y, 2) & "-" & Brr(Y, 1)
  8.             If A = B And Brr(Y, 3) = "" Then K = 0
  9.             If A = B And Arr(X, 4) <> "" And K <> 1 Then
  10.                 K = 1
  11.                 Brr(Y, 3) = Arr(X, 7)
  12.                 Brr(Y, 7) = "#0000" & Arr(X, 5)
  13.             Exit For
  14.             End If
  15.         Next Y
  16.     Next X

  17.     [¹w¬ù!A1].Resize(UBound(Brr, 1), UBound(Brr, 2)) = Brr

  18. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ PJChen ©ó 2021-1-17 18:24 ½s¿è

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

¸Õ¤F´X¦¸ÁÙ¬O¤£¦æ,½Ð¤j¤jÀ°¦£¬Ý¤Uµ{¦¡¡I
·PÁÂ
¹w¬ù¨úªO.rar (21.46 KB)

TOP

¦^´_ 5# ­ã´£³¡ªL
¤j¤j,

§Ú¸Õ¤F´X¦¸,³£µL°Ê§@,¤£ª¾µo¥Í¤°»ò¨Æ...

TOP

¦^´_ 4# PJChen


Sub ¹w¬ù§ó·s()
Dim Arr, xD, i&, T$
Set xD = CreateObject("Scripting.Dictionary")
Arr = Range([»¡©ú!R1], [»¡©ú!i65536].End(xlUp))
For i = 3 To UBound(Arr)
    If Arr(i, 1) <> "" And IsDate(Arr(i, 4)) Then
       T = Arr(i, 1) & "|" & Arr(i, 4) & "#0000" & Arr(i, 5)
       xD(T) = xD(T) + Val(Arr(i, 7))
    End If
Next i
Arr = Range([¹w¬ù!G1], [¹w¬ù!A65536].End(xlUp))
For i = 2 To UBound(Arr)
    T = Arr(i, 2) & "|" & Arr(i, 1) & Arr(i, 7)
    If xD.Exists(T) Then Arr(i, 3) = xD(T)
Next i
[¹w¬ù!A1].Resize(UBound(Arr), 7) = Arr
End Sub

TOP

        ÀR«ä¦Û¦b : ¬O«D·í±Ð¨|¡AÆg¬ü§@ĵ±§¡C
ªð¦^¦Cªí ¤W¤@¥DÃD