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

[µo°Ý] VBA¼gCountifªº¤½¦¡¶i¤JÀx¦s®æ

[µo°Ý] VBA¼gCountifªº¤½¦¡¶i¤JÀx¦s®æ

½Ð±Ð¥ý¶i¡G
Àx¦s®æ¤ºªºcountif ­pºâ¦¡ªº­ì«¬¬O ¡G¦bA2Àx¦s®æ¤º =countif( C2:C100, ">=" & B2)

¦pªG¦bVBAªºµ{¦¡½X «¬¦¡ À³¸Ó«ç»ò¼g?¡G
      range("A2").formula = "=countif(C2:C100, ........... "

¨ä¤¤­ì«¬¤w¨Ï¥Î¤F¦¨¹ïªº ' " ' ¤Î ¦ê±µ "&" ªº²Å¸¹¡A ¦pªG ®æ¦ì¦ì¸m(Address)¬O¥iÅܪº¤S«ç¿ì?

ÁÂÁÂ

¦^´_ 1# Scott090


    ±z¦n¡G

½Ð¸Õ¸Õ¦p¤U
Range("a2").Formula = Application.WorksheetFunction.CountIf(Range("c2:c100"), ">=" & Range("b2"))

TOP

¦^´_ 1# Scott090

¨Ï¥Î¥¨¶°¿ý»s«á¤w¸Ñ¨M¡G
   Countif ªº­ì«¬ ¡G =countif(C2:C100, ">=" & B2)

VBA ¤½¦¡«¬ºA¡G
   RANGE("A2").FORMULA = "=COUNTIF(C2:C100,"">="" & B2)"

   ¤Þ¥Ó¥[¤JÅܼƨϥΡF
dim DataPoints%
dim n%

DataPoints = 12345
n = 30
    For i = 1 To n
           Range("AA" & i ).Formula = "=COUNTIF($S$2:$S$" & DataPoints + 1 & ","">="" &  B" & i  & ")"
    Next

TOP

¦^´_ 2# dechiuan999


    ÁÂÁ¼ö¤ß¨ó§U
§Aªº¦¡¤l·|­pºâ "­È" ¨ìÀx¦s®æ

­ì´£·N¬O "¼g¤½¦¡" ¨ìÀx¦s®æ

TOP

¥»©«³Ì«á¥Ñ Scott090 ©ó 2014-8-3 18:59 ½s¿è
¦^´_  Scott090

¨Ï¥Î¥¨¶°¿ý»s«á¤w¸Ñ¨M¡G
   Countif ªº­ì«¬ ¡G =countif(C2:C100, ">=" & B2)

VBA  ...
Scott090 µoªí©ó 2014-8-3 18:40



Range("AA" & i). §ó¥¿¡G
Range("A" & i).Formula= "=Countif( C2:C" & datapoints +1 & ","">="" & B" & i &  ")"

TOP

¦^´_ 3# Scott090

°µ°Ñ¦Ò
¸ê®Æ¦ì¸m¤Î¸ê®Æªø«×¬OÅܼƮɪº¤Þ¥Ó¨Ï¥Î¡G
¨Ï¥Î Range.Address

dim DataPoints% , DataCol%
dim n%
dim Rng as Range

DataPoints = 12345
DataCol = 3  '¸ê®ÆÄæ¦ì C
n = 30
set Rng  = Range(Cells(2, DataCol), Cells(DataPoints + 1, DataCol))
    For i = 2 To n
           Range("A" & i).Formula= "=Countif(" & Rng.Address & ","">="" & B" & i &  ")"
    Next

TOP

¦^´_ 6# Scott090
  1. For i = 2 To n
  2.            Range("A" & i).Formula= "=Countif(" & Rng.Address & ","">="" & B" & i &  ")"
  3.     Next
½Æ»s¥N½X
¤£¥Î¶]°j°é§Ö¨Ç
  1. Range("A2:A" & n).Formula = "=Countif(" & Rng.Address(1, 1, xlR1C1) & ","">="" & RC[1])"
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 7# GBKEE


    ¤Ó·P®¦¤F
¤S¾Ç¤F¤@©Û

TOP

        ÀR«ä¦Û¦b : §ïÅܦۤv¬O¦Û±Ï¡A¼vÅT§O¤H¬O±Ï¤H¡C
ªð¦^¦Cªí ¤W¤@¥DÃD