- ©«¤l
- 1447
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1471
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-12-5
|
¦^´_ 17# s3526369
³o½d¨Ò¾ã²z¤F¤@¤U,¨Ã¥B§âSumIfªº §ï¬°SumIfs µo²{ºÃ°Ý
1.TC,TD,UC,UD³o´XÓÅܼƸò°õ¦æµ²ªG¬O¨S¦³Ãö«Y,©Ò¥Hµ{¦¡¦h¶]¤F0.5¬í
2.°h®w,¼o®ÆÜ ³o¨âÓ¤u§@ªí¤]¬O¸ò°õ¦æµ²ªG¬O¨S¦³Ãö«Y
½Ð±Ð«e½ú:
A.¬O½d¨Ò¤£§¹¾ã?
B.ÁÙ¬On©¿²¤¤Wz¨â¶µºÃ°Ý!²¤Æ¦p¤Uªºµ{¦¡½X
C.¨ä¥L
¦pªG¬OA ½Ð´£¨Ñ·sªº½d¨Ò,¦pªG¬OB «á¾ÇÄ~Äò¥H¤U¦Cµ{¦¡½X¬ã²ßÁYµu°õ¦æ®É¶¡,
¦pªG¬OC ½Ð¦A»¡©ú- Sub Ü®w®w¦s¦XpCOPY3()
- Application.ScreenUpdating = False
- Dim x, i As Long, DA, BA, bb, BC, FY, FX, EY, QA, QB, T
- Dim S, Srr, Arr, Ac, xR, C, xC
- T = Timer
- Set Srr = CreateObject("Scripting.Dictionary")
- '0 1 2 3 4 5 6 7
- S = Split("¤J®w©ú²Ó,¥þ¾÷ºØBOM,A»Ý¨D,b»Ý¨D,«ü¹Ï©ú²Ó,¥X®w©ú²Ó,¤½¥q½LÂI,Ü®w®w¦s", ",")
- For i = 0 To UBound(S)
- Set Srr(i) = Sheets(S(i))
- Next
- Ac = Srr(7).Cells(Rows.Count, 1).End(3).Row
- Arr = Range(Srr(7).[N4], Srr(7).Cells(Ac, 1))
- For i = 1 To Ac - 3
- xR = Arr(i, 1)
- Arr(i, 5) = WorksheetFunction.SumIfs(Srr(0).[R:R], Srr(0).[O:O], xR) '¤J®w¦Xp CCCCCCC
- TA = WorksheetFunction.SumIfs(Srr(0).[R:R], Srr(0).[O:O], xR, Srr(0).[S:S], "AÜ") '¤J®w©ú²Ó-A
- UA = WorksheetFunction.SumIfs(Srr(0).[R:R], Srr(0).[O:O], xR, Srr(0).[S:S], "BÜ") '¤J®w©ú²Ó-B
- Arr(i, 3) = WorksheetFunction.SumIfs(Srr(1).[Z:Z], Srr(1).[P:P], xR) '¤½¥qÁ`»Ý¨D CCCCCCC
- 'TC = WorksheetFunction.SumIfs(Srr(1).[U:U], Srr(1).[P:P], xR, Srr(1).[T:T], "AÜ") '¥þBOM-´Ý³æA»Ý¨D
- 'TD = WorksheetFunction.SumIfs(Srr(1).[V:V], Srr(1).[P:P], xR, Srr(1).[T:T], "AÜ") '¥þBOM-q³æA»Ý¨D
- 'UC = WorksheetFunction.SumIfs(Srr(1).[U:U], Srr(1).[P:P], xR, Srr(1).[T:T], "BÜ") '¥þBOM-´Ý³æB»Ý¨D
- 'UD = WorksheetFunction.SumIfs(Srr(1).[V:V], Srr(1).[P:P], xR, Srr(1).[T:T], "BÜ") '¥þBOM-q³æB»Ý¨D
- TE = WorksheetFunction.SumIfs(Srr(4).[L:L], Srr(4).[F:F], xR, Srr(4).[J:J], "AÜ") '«ü¹Ï©ú²Ó-A
- UE = WorksheetFunction.SumIfs(Srr(4).[L:L], Srr(4).[F:F], xR, Srr(4).[J:J], "BÜ") '«ü¹Ï©ú²Ó-B
- Arr(i, 13) = WorksheetFunction.SumIfs(Srr(4).[L:L], Srr(4).[F:F], xR) '«ü¹Ï©ú²Ó-Á`¥X³f CCCCCC
- PA = WorksheetFunction.SumIfs(Srr(4).[K:K], Srr(4).[F:F], xR) '«ü¹Ï©ú²Ó-¼o®Æ CCCCCC
- TB = WorksheetFunction.SumIfs(Srr(5).[R:R], Srr(5).[O:O], xR, Srr(5).[S:S], "AÜ") '¥X®w©ú²Ó-A
- UB = WorksheetFunction.SumIfs(Srr(5).[R:R], Srr(5).[O:O], xR, Srr(5).[S:S], "BÜ") '¥X®w©ú²Ó-B
- Arr(i, 11) = WorksheetFunction.SumIfs(Srr(5).[R:R], Srr(5).[O:O], xR, Srr(5).[S:S], "°h®w") '¥X®w©ú²Ó-°h®w
- PB = WorksheetFunction.SumIfs(Srr(5).[R:R], Srr(5).[O:O], xR, Srr(5).[S:S], "¼o®ÆÜ") '¥X®w©ú²Ó-¼o®Æ
- Arr(i, 4) = WorksheetFunction.SumIfs(Srr(6).[G:G], Srr(6).[A:A], xR) '¤W¤ë½LÂI¼Æ
- TF = WorksheetFunction.SumIfs(Srr(6).[F:F], Srr(6).[A:A], xR) '¤½¥q½LÂI-AÜ
- TG = WorksheetFunction.SumIfs(Srr(6).[K:K], Srr(6).[A:A], xR) '¤½¥q½LÂI-½Õ¾ãAÜ
- UF = WorksheetFunction.SumIfs(Srr(6).[E:E], Srr(6).[A:A], xR) '¤½¥q½LÂI-BÜ
- UG = WorksheetFunction.SumIfs(Srr(6).[J:J], Srr(6).[A:A], xR) '¤½¥q½LÂI-½Õ¾ãBÜ
- Arr(i, 10) = TF + TG + TA + TB - TE 'AÜ
- Arr(i, 9) = UF + UG + UA + UB - UE 'BÜ
- Arr(i, 12) = PA + PB
- XA = 0
- If Arr(i, 3) > 0 Then
- XA = Arr(i, 4) + Arr(i, 5) - Arr(i, 11) - Arr(i, 12) - Arr(i, 3)
- If XA > 0 Then
- XA = 0
- End If
- End If
- Arr(i, 6) = XA
- QA = Arr(i, 4) + Arr(i, 5) ' ''Ü®w®w¦s
- QB = Arr(i, 11) + Arr(i, 12)
- Arr(i, 8) = QA - QB - Arr(i, 10) - Arr(i, 9) - Arr(i, 13) ''¤½¥qÜ
- Arr(i, 7) = QA - QB - Arr(i, 13) ''Á`¼Æ
- Next i
- C = Array(, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)
- For i = 1 To UBound(C)
- Srr(7).Cells(4, C(i)).Resize(UBound(Arr), 1) = Application.Index(Arr, , C(i))
- Next
- MsgBox "¦@¯Ó®É¡G" & Timer - T & " ¬í"
- End Sub
½Æ»s¥N½X |
|