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

[µo°Ý] ¨Ì¶µ¥Ø¦WºÙ²Î­p¶i¾PÁ`ÃB¤§­pºâ...?

¦^´_ 15# cypd


    ÁÂÁ«e½ú¦^´_
«á¾Ç¾Ç²ß¤è®×¦p¤U,½Ð«e½ú°Ñ¦Ò

°õ¦æµ²ªG:



Sub TEST()
Dim Brr, V4&, V5&, Z, i&, T$, A&, Af&, B$, Bn&, D&, Df, Ra As Range
Set Z = CreateObject("Scripting.Dictionary")
Set Ra = Range([¤u§@ªí1!H3], [¤u§@ªí1!A65536].End(3)): Brr = Ra
For i = 1 To UBound(Brr)
   T = Brr(i, 3): V4 = Val(Brr(i, 4)): V5 = Val(Brr(i, 5))
   If V4 > 0 Then
      A = Z(T & "|¶i"): A = A + V4: Z(T & "|¶i") = A
      Af = Z(T & "|¶iÃB"): Af = Af + V4 * Val(Brr(i, 6))
      Z(T & "|¶iÃB") = Af
   End If
   Bn = Val(Brr(i, 8))
   If Bn > 0 Then
      B = Z(T & "|ÃرÔ")
      Z(T & "|ÃؼÆ") = Z(T & "|ÃؼÆ") + Bn
      If B = "" Then
         B = Brr(i, 1) & "¶µ_" & Brr(i, 2) & "_ÃØ_" & Bn
         Else
         B = B & " ¡¹" & Brr(i, 1) & "¶µ_" & Brr(i, 2) & "_ÃØ_" & Bn
      End If
      Z(T & "|ÃرÔ") = B: B = ""
   End If
   If V5 > 0 Then
      D = Z(T & "|¾P"): D = D + V5: Z(T & "|¾P") = D
      Df = Z(T & "|¾PÃB"): Df = Df + V5 * Val(Brr(i, 6))
      Z(T & "|¾PÃB") = Df
   End If
Next
Set Ra = Range([¤u§@ªí1!V2], [¤u§@ªí1!N65536].End(3)): Brr = Ra
For i = 2 To UBound(Brr)
   T = Brr(i, 1)
   Brr(i, 2) = Z(T & "|¶i")
   Brr(i, 3) = Z(T & "|¾P") + Z(T & "|ÃؼÆ")
   Brr(i, 4) = Brr(i, 2) - Brr(i, 3)
   Brr(i, 5) = Z(T & "|¶iÃB")
   Brr(i, 6) = Z(T & "|¾PÃB")
   Brr(i, 7) = Brr(i, 6) - Brr(i, 5)
   Brr(i, 8) = "¦@ÃØ¥X: " & Z(T & "|ÃؼÆ")
   Brr(i, 9) = Z(T & "|ÃرÔ")
Next
Ra = Brr: [U2] = "³Æµù"
Set Z = Nothing: Erase Brr: Set Ra = Nothing
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 12# Andy2483

«D±`·PÁ«e½ú  Andy2483  ¼ö¤ß¸Ñµª
Ãö©ó¦¹°Ý¦³¥H¤U¸É¥R
¡°¬O§_¯à¼W¥[¬ÕÁ«ª÷ÃB¤@Äæ ( T Äæ)

¥t¥~ U Äæ³ÆµùÃØ«~¼Æ¤§µù°O
¦P¤@°Ó«~¦]¤£¦P¾P³f¤é´Á©Ò­P
­Yµ§¼Æ¼W¦h...U³ÆµùÄ椺®e¤å¦r·|ÀH¤§©ìªø°ÝÃD  ?

TOP

¦^´_ 13# hcm19522

¤£¦n·N«ä  hcm19522

µLªkµn¤J©O  ?

TOP

google"EXCEL°g"  blog  ©Îgoogleºô§}:https://hcm19522.blogspot.com/

TOP

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

°õ¦æµ²ªG:



Sub TEST()
Dim Brr, V4&, V5&, Z, i&, T$, A&, Af&, B$, Bn&, D&, Df, Ra As Range
Set Z = CreateObject("Scripting.Dictionary")
Set Ra = Range([¤u§@ªí1!H3], [¤u§@ªí1!A65536].End(3)): Brr = Ra
For i = 1 To UBound(Brr)
   T = Brr(i, 3): V4 = Val(Brr(i, 4)): V5 = Val(Brr(i, 5))
   If V4 > 0 Then
      A = Z(T & "|¶i"): A = A + V4: Z(T & "|¶i") = A
      Af = Z(T & "|¶iÃB"): Af = Af + V4 * Val(Brr(i, 6))
      Z(T & "|¶iÃB") = Af
   End If
   Bn = Val(Brr(i, 8))
   If Bn > 0 Then
      B = Z(T & "|ÃرÔ")
      Z(T & "|ÃؼÆ") = Z(T & "|ÃؼÆ") + Bn
      If B = "" Then
         B = Brr(i, 1) & "¶µ_" & Brr(i, 2) & "_ÃØ_" & Bn
         Else
         B = B & " ¡¹" & Brr(i, 1) & "¶µ_" & Brr(i, 2) & "_ÃØ_" & Bn
      End If
      Z(T & "|ÃرÔ") = B: B = ""
   End If
   If V5 > 0 Then
      D = Z(T & "|¾P"): D = D + V5: Z(T & "|¾P") = D
      Df = Z(T & "|¾PÃB"): Df = Df + V5 * Val(Brr(i, 6))
      Z(T & "|¾PÃB") = Df
   End If
Next
Set Ra = Range([¤u§@ªí1!S2], [¤u§@ªí1!M65536].End(3)): Brr = Ra
For i = 2 To UBound(Brr)
   T = Brr(i, 1)
   Brr(i, 2) = Z(T & "|¶i")
   Brr(i, 3) = Z(T & "|¾P") + Z(T & "|ÃؼÆ")
   Brr(i, 4) = Brr(i, 2) - Brr(i, 3)
   Brr(i, 5) = Z(T & "|¶iÃB")
   Brr(i, 6) = Z(T & "|¾PÃB")
   Brr(i, 7) = Z(T & "|ÃرÔ")
Next
Ra = Brr: [S2] = "³Æµù"
Set Z = Nothing: Erase Brr: Set Ra = Nothing
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 10# ¬PªÅÉ@¦ÐÁl

  «D±`·PÁ ¬PªÅÉ@¦ÐÁl ¼ö¤ß@¦^ÂÐ
«D±`¯«©_ªº²[¼Æ¤½¦¡
¤ñ¹ï²Å¦X­n¥ó¤§«á¬Û­¼¬Û¥[...
§Æ±æµ§¼Æ­Y¦h¤£¼vÅT¹Bºâ...·P®¦¸Ñµª  ^^

TOP

¦^´_ 9# cypd

¨S¦³»²§UÄ檺¨ç¼Æ¦p¤U
°ò¥»¤W¬O¤ñ¹ï«á§ì¸ê®Æ
µM«á¬Û­¼
¦b¬Û¥[

¨ç¼Æ¤½¦¡¦p¤U
  =SUM(IFERROR(((IF(MATCH($C$3:$C$32,$J$3:$J$10,0)=(MATCH($J3,$J$3:$J$10,0)),$D$3:$D$32,"")*(IF(MATCH($C$3:$C$32,$J$3:$J$10,0)=(MATCH($J3,$J$3:$J$10,0)),$F$3:$F$32,"")))),""))


1120626-3.zip (13.75 KB)

«á¾Ç¨Ì¦Û¤v¸gÅç¡A¦C¥X¤W­z¤½¦¡
¤@©w¦³§ó¦nªº¤½¦¡©Î¬O¥i¥H²¤Æªº¼gªk
¦A½Ð¦U¦ì¤j¤j«ü¾É¡A·PÁ¡C

TOP

¦^´_ 8# ¬PªÅÉ@¦ÐÁl

«D±`·PÁ ¬PªÅÉ@¦ÐÁl ¼ö¤ß@¦^ÂÐ
¨Ì¾Ú©Ò«Øij¼W¥[¨âÄ滲§U(¶i³fÁ`ÃB¤Î¾P³fÁ`ÃB)
©î¤À«á¦A¨ÌSUMIF¨ç¼Æ°}¦C¤½¦¡¨Ó¶i¦æ¥[Á`  ;P :victory:
©Ò´£°ÝÃD¤wÀò±o©Ò»Ý¥¿½T¼Æ¾Ú¡K·P®¦  ^^

TOP

¦^´_ 5# cypd

«á¾Ç©µÄòSUMIF¨ç¼ÆÀ³¥Î¡A´£¨Ñ¤@­Ó²Â¤è¦¡
¤è¦¡»¡©ú¦p¤U
¼W¥[¨â¦C»²§UÄæ¡A¥Î¨Ó©î¤À¶i³fÁ`ÃB¤Î¾P³fÁ`ÃB
©î¤À«á¦A¨ÌSUMIF¨ç¼Æ¨Ó¶i¦æ¥[Á`

    1120626-2.rar (11.39 KB)

p.s­Y¤£¥i¼W¥[»²§UÄæ¡A«á¾Ç¦A·Q·Q§Oªº¤è¦¡¡C

TOP

¦^´_ 6# ¬PªÅÉ@¦ÐÁl

¬Oªº  ^^

TOP

        ÀR«ä¦Û¦b : ¦³Ä@©ñ¦b¤ß¸Ì¡A¨S¦³¨­Åé¤O¦æ¡A¥¿¦p¯Ñ¥Ð¤£¼½ºØ¡A¬Ò¬OªÅ¹L¦]½t¡C
ªð¦^¦Cªí ¤W¤@¥DÃD