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

[µo°Ý] ½Ð°Ý,¦p¦ó¨Ï¥Îvba countif excel ¤Gºû°}¦C¤¤¤§¼Æ¦r¨Ã§@¦¨¤U©Ô¦¡¿ï³æ¤§²M³æ

[µo°Ý] ½Ð°Ý,¦p¦ó¨Ï¥Îvba countif excel ¤Gºû°}¦C¤¤¤§¼Æ¦r¨Ã§@¦¨¤U©Ô¦¡¿ï³æ¤§²M³æ

Dear ¦U¦ì¤j¤j :
¤p§Ì¦³¤@°ÝÃD·Q½Ð±Ð¦U¦ì¤j¤j,Ãö©ó¦p¦ó¨Ï¥Îexcel vba countif ¤@­Ó¤Gºû°}¦C¤§¼Æ¦r,±Æ§Ç«á,§R°£"0"¨Ã¦Û¦¨¬°¤U©Ô¦¡¿ï³æ¤¤¤§¼Æ¦r½d³ò,ÁÂÁ !




¦Û°Ê¿z¿ï°ÊºA¤U©Ô¦¡¿ï³æ_20120809.zip (9.88 KB)

¦^´_ 1# cmo140497
¸Õ¸Õ¬Ý
  1. Sub Ex()
  2.     Dim Rng As Range, i As Integer, S As Integer
  3.     Dim Ar '() <-°ÊºA°}¦C
  4.     With Sheets("sheet3")
  5.         Set Rng = .Range("b14:o23")
  6.         For i = Application.Min(Rng) To Application.Max(Rng)
  7.             Debug.Print i & ":" & Application.CountIf(Rng, i)
  8.             If Application.CountIf(Rng, i) > 0 Then
  9.                 Ar = Ar & IIf(Ar <> "", "," & i, i)  '°ÊºA°}¦C®É µù¸Ñ¦¹¦æµ{¦¡½X(¤£»Ý¦¹¦æµ{¦¡½X)
  10.                 'ReDim Preserve Ar(S)
  11.                 'Ar(S) = "" & i
  12.                 'S = S + 1
  13.             End If
  14.         Next
  15.         Ar = Split(Ar, ",")   '°ÊºA°}¦C®É µù¸Ñ¦¹¦æµ{¦¡½X(¤£»Ý¦¹¦æµ{¦¡½X)
  16.         .Shapes(1).ControlFormat.List = Ar
  17.     End With
  18. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¦³¦h¤Ö¤O¶q´N°µ¦h¤Ö¨Æ¡A¤£­n¤ß¦sµ¥«Ý¡Aµ¥«Ý¤~·|¸¨ªÅ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD