- ©«¤l
- 21
- ¥DÃD
- 5
- ºëµØ
- 0
- ¿n¤À
- 67
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN10
- ³nÅ骩¥»
- 10
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2018-7-23
- ³Ì«áµn¿ý
- 2020-9-3
|
[µo°Ý] ¥ÎVBA °õ¦æCOUNTIF «á¡A¶KȤΤu§@¶ªººÃ°Ý¤Î²¤ÆVBA
¦³½Ð°Ýª©¤Wªº°ª¤â¡C
COUNTIF -TEST.zip (41.72 KB)
§Ú¥Î¿ý»s¥¨¶°ªº¤è¦¡·Q²Îp¥X ª÷¿Ä/¹q¤l/¶Ç²£ªº¤º¥~½L¨Ã°µ¦¨¶ê»æ¹Ï·Qn¤è«KÆ[¹î¡C
¦ý¬O¹J¨ì´XÓ°ÝÃD¡C
1-¥Øªº·Qn¨C10¬íÄÁ°õ¦æ¥¨¶°«á¹Bºâ¤@¦¸µM«áµe¶ê»æ¹Ï ¡A ¦ý¥¨¶°¤@°õ¦æ¡A¤u§@ªí1ªºABC¦æªºRAND ȳ£¤£·|¸õ°Ê¤F(¥¨¶°¨S°õ¦æ®É·|¦Û¤w¸õ°Ê) ¡C§Ú¤]¨S¿ëªk¤Á¨ì¨ä¥¦¤u§@ªí°µ¨ä¥¦¨Æ
¦³¿ëªkÅý¹Bºâ¥u¦b¤u§@¶1 ¦Û¤wI´º°õ¦æ §ÚÁÙ¥i¥H°µ¨ä¥¦Àx¦s®æªºKEY IN¶Ü¡H
2-ªþ¥ó¬O·Qn§Q¥ÎVBA¦b$E$1 °µ§¹COUNTIF ¹Bºâ«á ¦A¶K"Ȩì¤U¤è ¡C ·Q»¡³o¼Ë¥i¥H¸`¬ÙEXCEL ¦bª÷¿Ä/¶Ç²£/¹q¤l/¤º¥~½L12®æ¤º¼g¤@¼Ëªº¤½¦¡®ö¶OEXCEL¹Bºâ®É¶¡¡C
¥i¬O¿ý»s¥X¨ÓªºVBA ·Pı¤]¬O¶K¤F12¦¸¤@¼Ëªº¹Bºâ ¡H ¥i¥H¦³°ª¤âÀ°¦£Â²¤Æ¶Ü¡H
3- ¦]¬°·Qn¦bEXCEL¤@¥´¶}«á ´N¤£ºÞ³oÓCONUTIF Åý¥¦¦Û¤w¦b¤u§@¶1¦Û¤wI´º°õ¦æ ¡C EXCEL ÁY¤p©Î¤Á´«¨ì¨ä¥¦ªº EXCEL Àɮר䣼vÅT³oÓCOUNTIF ¤u§@¶ªº°õ¦æ
³o»yªkÁٻݰµ¤°»ò³]©w¶Ü¡H ÁÙ¬O§Ú»Ýn§âVBAµ{¦¡¶K¦b¤u§@ªí1¤º¡AµM«á¤u§@ªí1³]©w¦¨worksheet «Å§i¦¨calculation ©O¡H
4- ¤@ª½·d¤£À´¥¨¶°°õ¦æ«á n«ç»ò§â¥¨¶°°±¤î¡C¬O§_¦³»yªk¥i¥H§Ö³t¤¤Â_vba¡H
½Ð°ª¤âÀ°À°¦£¸Ñµª¡C·PÁÂ
Sub ¥Æض¢X10sec()
'
'
'
'¤º¥~½L
Range("E1").FormulaR1C1 = "=COUNTIF(R[4]C[-4]:R[935]C[-4],1)"
Range("E1").Copy
Range("E5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("E1").FormulaR1C1 = "=COUNTIF(R[4]C[-4]:R[935]C[-4],-1)"
Range("E1").Copy
Range("F5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("E1").FormulaR1C1 = "=COUNTIF(R[4]C[-4]:R[935]C[-4],0)"
Range("E1").Copy
Range("G5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'¶Ç²£
Range("E1").FormulaR1C1 = "=COUNTIF(R[4]C[-3]:R[257]C[-3],1)"
Range("E1").Copy
Range("E7").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("E1").FormulaR1C1 = "=COUNTIF(R[4]C[-3]:R[257]C[-3],-1)"
Range("E1").Copy
Range("F7").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("E1").FormulaR1C1 = "=COUNTIF(R[4]C[-3]:R[257]C[-3],0)"
Range("E1").Copy
Range("G7").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'ª¡Ò¿Ä
Range("E1").FormulaR1C1 = "=COUNTIF(R[461]C[-3]:R[492]C[-3],1)"
Range("E1").Copy
Range("E9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("E1").FormulaR1C1 = "=COUNTIF(R[461]C[-3]:R[492]C[-3],-1)"
Range("E1").Copy
Range("F9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("E1").FormulaR1C1 = "=COUNTIF(R[461]C[-3]:R[492]C[-3],0)"
Range("E1").Copy
Range("G9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'¹q¤l
Range("E1").FormulaR1C1 = "=COUNTIF(R[258]C[-3]:R[397]C[-3],1)+COUNTIF(R[508]C[-3]:R[562]C[-3],1)"
Range("E1").Copy
Range("E11").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("E1").FormulaR1C1 = "=COUNTIF(R[258]C[-3]:R[397]C[-3],1)+COUNTIF(R[508]C[-3]:R[562]C[-3],-1)"
Range("E1").Copy
Range("F11").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("E1").FormulaR1C1 = "=COUNTIF(R[258]C[-3]:R[397]C[-3],1)+COUNTIF(R[508]C[-3]:R[562]C[-3],0)"
Range("E1").Copy
Range("G11").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Call Second
End Sub
Sub Second()
'
'
Application.OnTime Now + 10 / 86400#, "¥Æض¢X10sec"
End Sub |
|