¦³Ãösumif¨ç¼Æªº°ÝÃD·Q½Ð±Ð¡H
- ©«¤l
- 84
- ¥DÃD
- 13
- ºëµØ
- 0
- ¿n¤À
- 104
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- SP3
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-8-10
- ³Ì«áµn¿ý
- 2018-4-21
|
¦³Ãösumif¨ç¼Æªº°ÝÃD·Q½Ð±Ð¡H
¦U¦ì¥ý¶i¤j®a¦n¡I¦]¬°¤§«e¹ï©óVBA»yªkªº¾Ç²ß¿³½ì¡A©Ò¥H·Q»¡À³¥Î¦b¥Í¬¡¤W¡C©ó¬O¤p§Ì§Ú¥Îsumif¨ç¼Æ¼g¤F¤@Ó¥[Á`ÂI¼Æªº»yªk¡C»yªk¦p¤U
Sub Worksheet_Deactivate()
Dim a1, a2, a3, i As Integer
For i = 1 To 40
With Sheets("¤À°tªí")
a1 = Application.SumIf(Range("D3:D52"), i, Range("C3:C21"))
a2 = Application.SumIf(Range("h3:h52"), i, Range("g3:g52"))
a3 = Application.SumIf(Range("l3:l52"), i, Range("k3:k52"))
Sheets("²Îpªí").Range("b" & i + 1).Value = a1 + a2 + a3
End With
Next i
End Sub
³o»yªk¬O¹B¦æµL»~ªº¡A¦ý¤µ¤Ñ¤ß¦å¨Ó¼é¡A·Q§â¥¦°µÓ¤jÂX¥R¡A©ó¬O¤S¼W¥[¤F´XÓ¤u§@ªí¡A¤S§ï¤F»yªk¦p¤U¡G
Sub Worksheet_Activate()
Dim a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, i
For i = 1 To 22
With Sheets("¯Z¯Å·F³¡")
a1 = Application.SumIf(Range("D2:D23"), i, Range("C2:C23"))
a2 = Application.SumIf(Range("h2:h23"), i, Range("g2:g23"))
a3 = Application.SumIf(Range("l2:l23"), i, Range("k2:k23"))
End With
With Sheets("±½¦a¤u§@")
a4 = Application.SumIf(Range("D2:D23"), i, Range("C2:C23"))
a5 = Application.SumIf(Range("h2:h23"), i, Range("g2:g23"))
a6 = Application.SumIf(Range("l2:l23"), i, Range("k2:k23"))
End With
With Sheets("¨C¶g¤u§@")
a7 = Application.SumIf(Range("D2:D23"), i, Range("C2:C23"))
a8 = Application.SumIf(Range("h2:h23"), i, Range("g2:g23"))
a9 = Application.SumIf(Range("l2:l23"), i, Range("k2:k23"))
End With
With Sheets("Ó¤Hªí²{")
a10 = Application.SumIf(Range("D2:D23"), i, Range("C2:C23"))
a11 = Application.SumIf(Range("h2:h23"), i, Range("g2:g23"))
a12 = Application.SumIf(Range("l2:l23"), i, Range("k2:k23"))
End With
Sheets("²Îpµ²ªG").Range("b" & i + 1).Value = a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9 + a10 + a11 + a12
Next i
End Sub
µ²ªG«o¤@°Ê¤]¤£°Ê¡A¯u¬O¶Ë¸£µ¬¡C§Úªá¤F¤T¡B¥|Ó¤p®É¡A§Y¨Ï¸£µ¬¥´µ²¡A«o¤]ºN¤£µÛÀYºü¡C¦³³Ò¦U¦ì¤F¡A¥i§_§iª¾¤p§Ì³o»yªkªº°ÝÃD¦bþ¸Ì¡Hªþ¤WÀɮסI |
|
|
|
|
|
|
- ©«¤l
- 472
- ¥DÃD
- 5
- ºëµØ
- 0
- ¿n¤À
- 485
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows
- ³nÅ骩¥»
- MS Office
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- ¨Ó¦Û
- »´ä
- µù¥U®É¶¡
- 2010-7-4
- ³Ì«áµn¿ý
- 2014-12-28
|
¥u®t¤@ÂIÂI, ´N¬O¦b¨CÓRANGE «e¥[¤@ÂI, ¤£µMRANGE(XX)¬O·í«e¶ªºRANGE, .RANGE ¬OWITH¶¤UªºRANGE- Sub Worksheet_Activate()
- Dim a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, i
- For i = 1 To 22
- With Sheets("¯Z¯Å·F³¡")
- a1 = Application.SumIf(.Range("D2:D23"), i, .Range("C2:C23"))
- a2 = Application.SumIf(.Range("h2:h23"), i, .Range("g2:g23"))
- a3 = Application.SumIf(.Range("l2:l23"), i, .Range("k2:k23"))
- End With
- With Sheets("±½¦a¤u§@")
- a4 = Application.SumIf(.Range("D2:D23"), i, .Range("C2:C23"))
- a5 = Application.SumIf(.Range("h2:h23"), i, .Range("g2:g23"))
- a6 = Application.SumIf(.Range("l2:l23"), i, .Range("k2:k23"))
- End With
- With Sheets("¨C¶g¤u§@")
- a7 = Application.SumIf(.Range("D2:D23"), i, .Range("C2:C23"))
- a8 = Application.SumIf(.Range("h2:h23"), i, .Range("g2:g23"))
- a9 = Application.SumIf(.Range("l2:l23"), i, .Range("k2:k23"))
- End With
- With Sheets("Ó¤Hªí²{")
- a10 = Application.SumIf(.Range("D2:D23"), i, .Range("C2:C23"))
- a11 = Application.SumIf(.Range("h2:h23"), i, .Range("g2:g23"))
- a12 = Application.SumIf(.Range("l2:l23"), i, .Range("k2:k23"))
- End With
- Sheets("²Îpµ²ªG").Range("b" & i + 1).Value = a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9 + a10 + a11 + a12
- Next i
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|
- ©«¤l
- 84
- ¥DÃD
- 13
- ºëµØ
- 0
- ¿n¤À
- 104
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- SP3
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-8-10
- ³Ì«áµn¿ý
- 2018-4-21
|
ü§r¡I¯u¬O¸£³U¬ðµM¥d¦í¤F¡C§Ú«ç»ò¨Sª`·N¨ì¡Aì¨Ó¤@¶}©lªº»yªk´N¿ù¤F¡A¥u¬O³±¿ù¶§®t¡C©Ò¥H«á¨Ó¤S¼W¥[¤u§@ªí¤§«á´N·|¥X°ÝÃD¡C¯u¬O·PÁ¡C |
|
|
|
|
|
|