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

¡u©I¥s¤u§@ªí¨ç¼Æ¡v¨Ï¥Î¤Wªº°ÝÃD¡A½Ð¤£§[«ü±Ð

¡u©I¥s¤u§@ªí¨ç¼Æ¡v¨Ï¥Î¤Wªº°ÝÃD¡A½Ð¤£§[«ü±Ð

¤j®a¦n~
§Ú·Q½Ð°Ýªº¬O¦bVBA¤¤¡A¦pªG¨Ï¥ÎApplication.WorksheetFunction.CountIf
§Ú·Q¦bsheet1ªºAÄ椤³v¤@¤ñ¹ïsheet2ªºAÄ椤¬O§_¤w¥X²{
­Ó¤H¼gªºCode¦p¤U
Dim myrange As Range
    w = 2
    Do While Sheet1.Cells(w, "A") <> Empty
        ww = Sheet1.Cells(w, "A")
        Set myrange = Worksheets(2).Range("A:A")
        yy = Application.WorksheetFunction.CountIf(myrange, ww)
        If yy <> 0 Then Exit Do
    ....
    w = w + 1
    Loop
ww¬O°Ó«~¥N½X¡A°ÝÃD¥X¦bCOUNTIF²Ä¤G­Ó¤Þ¼Æ¦ü¥G¦b¥ÎÅܼƼg¤J®É¥Îªk¤£¹ï¡K
³Â·Ð¦U¦ì¥ý¶i«üÂI¤@¤G~·PÁÂ
¤£¶i«h°h

¤j®a¦n~
§Ú·Q½Ð°Ýªº¬O¦bVBA¤¤¡A¦pªG¨Ï¥ÎApplication.WorksheetFunction.CountIf
§Ú·Q¦bsheet1ªºAÄ椤³v¤@ ...
mnsmrtl µoªí©ó 2010/8/13 10:19 PM


«Øij±z¤W¶ÇÀÉ®×! ¤º§t... ªºcode¦nÃø²z¸Ñ~


³o¬O¨ç¼Æªº»¡©ú ±z¥i¥H¥ý°Ñ¦Ò¤@¤U!

Snap1.jpg (23.23 KB)

Snap1.jpg

­Y¬O§Ú¦^µª¡A¨Ï±zº¡·N¡A½Ð±zÅý§Úª¾¹D¡I                  
­Y¬O§Úªº¦^ÂСA±z¤´¦³¨ä¥L¨£¸Ñ¡A¤]½Ð±z¤£¶Þ«ü±Ð¡I

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2010-8-14 08:46 ½s¿è

¦^´_ ¼Ó¥D
ww¬O°Ó«~¥N½X¡A°ÝÃD¥X¦bCOUNTIF²Ä¤G­Ó¤Þ¼Æ¦ü¥G¦b¥ÎÅܼƼg¤J®É¥Îªk¤£¹ï¡K
§A¥uªþ¤W¤ù¬qªºµ{¦¡½X ¥B¬Ý¤£¨ìww ¥N¶i¨Óªº¸ê®Æ µL±q¬d°_

TOP

¦^´_ 3# GBKEE

©êºp¨S§â°ÝÃDÁ¿²M·¡¡A§Ú¬O·Q§âsheet1¡uDDE¡vªºdata
²Å¦X±ø¥ó«á¼g¤J¨ìsheet2¡uºÊ±±¡v¡A¦Ó¦b¼g¤J®É§Æ±æ¯à¥ý¤ñ¹ïSheet2¬O§_¦³­«ÂЪº¼Ðªº
­YµL«hª½±µ«Ø¥ß¦b¬J¦³¸ê®Æªº¤U¤è¡A©Ò¥H§Ú´N¥Îcountif¥hÀˬd
ww¥Nªíªº¬OªÑ²¼ªº¥N½X¡A¤£ª¾¹D¬O¤£¬O¸Ó¥[¤J¡u"¡v¡A¤@ª½µLªk¥¿±`¹B§@¡A·PÁÂ

ªÑDDE.zip (19.87 KB)

¤£¶i«h°h

TOP

¦^´_ 4# mnsmrtl

yy = Application.WorksheetFunction.CountIf(Myrange, ww)  '³o¦æ¨S¿ù
If yy <> 0 Then
           ' Exit Do    Â÷¶}¦^°é  ´Nµ²§ôµ{¦¡   ½Ð§R±¼³o¦æ
  Sheet1.Cells(w, "O") = 1
'
'

TOP

­ì¨Ó¦p¦¹¡A§ÚÀ´¤F¡A·PÁ¼ӤW¤j¤jªº«ü¾É
¤£¶i«h°h

TOP

        ÀR«ä¦Û¦b : ­n§åµû§O¤H®É¡A¥ý·Q·Q¦Û¤v¬O§_§¹¬üµL¯Ê¡C
ªð¦^¦Cªí ¤W¤@¥DÃD