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

[µo°Ý] ½Ð°Ý¦p¦ó¤ÀÅu¶O¥Î¨ì¯S©w«~¶µ?

[µo°Ý] ½Ð°Ý¦p¦ó¤ÀÅu¶O¥Î¨ì¯S©w«~¶µ?

¥»©«³Ì«á¥Ñ gaishutsusuru ©ó 2023-8-17 21:30 ½s¿è

¦U¦ì«e½ú¦n¡A

·Q½Ð±Ð«e½ú¤@­Ó°ÝÃD¡A²Ó¸`¦p¤U¡G

»¡©ú¡G
(1) Äæ¦ì¡GA~DÄæ¡BKÄ椧«á¬O¸ê®Æ¡CEÄæ¶î¶À¦â³B¬O§Æ±æ¯à°µ¥X¨Óªº¤½¦¡¡CF~IÄæ(²L¦Ç¦â)¶È¬O¬°¤F»¡©ú¦Ó°µªºÄæ¦ì¡A¹ê»Ú¤W¤£·|¦³F~IÄæ¡C
(2) ¤å¨ã¥Î«~ªº¶O¥Î¬O¥Ñ3­Ó²Ó¶µ©Ò²Õ¦¨¡G¬ãµo¶O¡B¹B¶O¡BÂø¶O
(2-1) ¤å¨ã¥Î«~ªº¬ãµo¶O¡G¤£»Ý¥ÑA1¡BA3ÂkÄÝ¡C¦]¦¹ª÷ÃB$10,000¨ÌA2¡BA4ªº°â¥Xª÷ÃB¥e¤ñ¥hÅuµ¹A2¡BA4¡Cµ²ªG¥i°Ñ·ÓFÄ檺ª÷ÃB¡C
(2-2) ¤å¨ã¥Î«~ªº¹B¶O¡G¤£»Ý¥ÑA2ÂkÄÝ¡C¦]¦¹ª÷ÃB$6,000¨ÌA1¡BA3¡BA4ªº°â¥Xª÷ÃB¥e¤ñ¥hÅuµ¹A1¡BA3¡BA4¡Cµ²ªG¥i°Ñ·ÓGÄ檺ª÷ÃB¡C
(2-3) ¤å¨ã¥Î«~ªºÂø¶O¡G¥iÂkÄÝA1~A4¡C¦]¦¹ª÷ÃB$12,000¨ÌA1~A4ªº°â¥Xª÷ÃB¥e¤ñ¥hÅuµ¹A1~A4¡Cµ²ªG¥i°Ñ·ÓHÄ檺ª÷ÃB¡C
(3) ±Ð«Ç³]³Æªº¶O¥Î¬O¥Ñ3­Ó²Ó¶µ©Ò²Õ¦¨¡G¤ô¹q¶O¡B¹B¶O¡BÂø¶O
(3-1) ±Ð«Ç³]³Æªº¤ô¹q¶O¡G¤£»Ý¥ÑB1¡BB2ÂkÄÝ¡C¦]¦¹ª÷ÃB$20,000¨ÌB3ªº°â¥Xª÷ÃB¥e¤ñ¥hÅuµ¹B3¡Cµ²ªG¥i°Ñ·ÓIÄ檺ª÷ÃB¡C
(3-2) ±Ð«Ç³]³Æªº¹B¶O¡G¤£»Ý¥ÑB3ÂkÄÝ¡C¦]¦¹ª÷ÃB$5,000¨ÌB1¡BB2ªº°â¥Xª÷ÃB¥e¤ñ¥hÅuµ¹B1¡BB2¡Cµ²ªG¥i°Ñ·ÓGÄ檺ª÷ÃB¡C
(3-3) ±Ð«Ç³]³ÆªºÂø¶O¡G¥iÂkÄÝB1~B3¡C¦]¦¹ª÷ÃB$2,000¨ÌB1~B3ªº°â¥Xª÷ÃB¥e¤ñ¥hÅuµ¹B1~B3¡Cµ²ªG¥i°Ñ·ÓHÄ檺ª÷ÃB¡C
(4)
(4-1) ¤å¨ã¥Î«~ªº¥N¸¹¬OA1~A4¡A¤]¦]¦¹NÄ椧«áªº¡u¤£»ÝÂkÄݪº²£«~¥N¸¹¡÷¡v¥u­nKÄ檺¶O¥ÎÃþ§O¬O¤å¨ã¥Î«~¡A«h¹ïÀ³ªºNÄ椧«á¶ñªº¤@©w·|¬OA1~A4¤§¤¤ªº¥N¸¹¡C
(4-2) ±Ð«Ç³]³Æªº¥N¸¹¬OB1~B3¡A¤]¦]¦¹NÄ椧«áªº¡u¤£»ÝÂkÄݪº²£«~¥N¸¹¡÷¡v¥u­nKÄ檺¶O¥ÎÃþ§O¬O±Ð«Ç³]³Æ¡A«h¹ïÀ³ªºNÄ椧«á¶ñªº¤@©w·|¬OB1~B3¤§¤¤ªº¥N¸¹¡C
(5) ¹ê»Ú¤Wªº¸ê®Æ·|¦³§ó¦hªº²£«~Ãþ§O¡B²£«~¥N¸¹¡B²£«~¦WºÙ ¡A¦b¦¹¶ÈÁ|¥X²¤Æ¨Ò¤l¡C
(6) ªþ¤WÀɮצp¥k¡G ·s¼W Microsoft Excel Worksheet.zip (7.86 KB)

¥H¤W¬O³o­Ó¨Ò¤lªº»¡©ú¡A¾ã­Óªº·§©À²³æ¤@¥y¸Ü´N¬O¡u§â¤£»ÝÂkÄݪº²£«~¥N¸¹±Æ°£±¼¡A¥h¥Ñ¨ä¥L²£«~¨Ì°â¥Xª÷ÃB¥e¤ñ¤ÀÅu¸Óµ§¶O¥Î¡v¡C§Æ±æ«e½ú¯à©âªÅ¨ó§UÀ°¦£³]­pEÄ檺¤½¦¡¡AÁÂÁ«e½ú¡C

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

TOP

¦^´_ 2# hcm19522


    ÁÂÁ«e½úµoªí¦¹¥DÃD»P½d¨Ò
«á¾ÇÂǦ¹©«½m²ß°}¦C»P¦r¨å,¾Ç²ß¤è®×¦p¤U,½Ð«e½ú°Ñ¦Ò
·s¼W_20230923.zip (18.15 KB)

°õ¦æ«e:


°õ¦æµ²ªG:



Option Explicit
Sub TEST()
Dim Arr, Brr, Crr, Z, Q, R&, i&, j%, T$, ¶O¥Î¶µ%
If [E2] <> "" Then Range([E2], [E65536].End(3)).ClearContents: Exit Sub
Range([E2], [E65536].End(3)(2)).ClearContents
Set Z = CreateObject("Scripting.Dictionary")
Brr = Range([N1], [K65536].End(3))
Crr = Range([E1], [A65536].End(3)): R = UBound(Crr)
ReDim Arr(1 To R, 1 To 10)
For i = 2 To UBound(Brr)
   If Z(Brr(i, 2)) = "" Then ¶O¥Î¶µ = ¶O¥Î¶µ + 1: Z(Brr(i, 2)) = 0: Arr(1, ¶O¥Î¶µ) = Brr(i, 2)
   T = Brr(i, 1) & "|" & Brr(i, 2)
   Z(T) = Brr(i, 3)
   For Each Q In Split(Brr(i, 4), ",")
      If Q <> "" Then Z(T & "|" & Q) = Brr(i, 3)
   Next
Next
For i = 2 To R
   For j = 1 To ¶O¥Î¶µ
      T = Crr(i, 1) & "|" & Arr(1, j)
      Arr(i, j) = Z(T) - Z(T & "|" & Crr(i, 2))
      If Arr(i, j) <> 0 Then Z(T & "/t") = Z(T & "/t") + Crr(i, 4)
   Next
Next
For i = 2 To R
   For j = 1 To ¶O¥Î¶µ
      T = Crr(i, 1) & "|" & Arr(1, j)
      If Z(T & "/t") > 0 Then Crr(i - 1, 1) = Val(Crr(i - 1, 1)) + Arr(i, j) * (Crr(i, 4) / Z(T & "/t"))
   Next
Next
[E2].Resize(R - 1, 1) = Crr
Set Z = Nothing: Erase Arr, Brr, Crr
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

        ÀR«ä¦Û¦b : ¤Ó¶§¥ú¤j¡B¤÷¥À®¦¤j¡B§g¤l¶q¤j¡A¤p¤H®ð¤j¡C
ªð¦^¦Cªí ¤W¤@¥DÃD