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

[µo°Ý] ¯S©w½d³ò¤º¤w¨Ï¥Î¦C¼Æ­pºâ

[µo°Ý] ¯S©w½d³ò¤º¤w¨Ï¥Î¦C¼Æ­pºâ

·Q½Ð°Ý¤@­Ó»yªk
¤u§@ªí¤¤
AÄ檺¸ê®Æ5­Ó¡AA1~A5
BÄ檺¸ê®Æ5­Ó¡AB1~B5
CÄ檺¸ê®Æ10­Ó¡AC1~C10

¦pªG§Ú³o»ò¼g
Dim a
a = usedrange.rows.count
±o¨ìªº¬O10

¦ý¬O§Ú¥u·Q­nA,B¨âÄæ¤w¨Ï¥Îªº¦C¼Æ
a = Range("A1:B100").usedRange.rows.count
·|¿ùÕÙ

UsedRange¦n¹³¥u¯à­pºâ¾ã±i¤u§@ªí¡A¤£¯àºâ¯S©w½d³ò¤ºªº

¨º§Ú¸Ó«ç»ò¿ì§ï©O¡H
ÁÂÁÂ
«¢Åo~¤j®a¦n§r

§Ú§ä¨ì¥Îªk¤F
¦pªG¬O¤U¨ç¼Æ ´N¬O =countA("B1:B100")  ³o¼Ë·|ºâ¥X 5

¦ý¬OVBA¥Îªk ­n¼g a = Application.CountA("B1:B100")
¥i¬O¬°¤°»ò§Ú±o¨ì³£¬O 1 ¦Ó¤w
??
«¢Åo~¤j®a¦n§r

TOP

«á¨Ó¹Á¸Õ  ­n«ü©w¤u§@ªí¤Î½d³ò¤§«á
´N¥¿±`¤F

¦p¤U
a = Application.CountA(Sheets("¤u§@ªí1").Range("B1:B100"))
«¢Åo~¤j®a¦n§r

TOP

­è·Q¤F·Q
countA¥u¯à³æ¤@Äæ¥h­pºâ¦³´X­Ó
¨Ó·í§@¸ê®Æ¥Î¨ì²Ä´X¦C

¥i¬O¦pªG¤¤¶¡¦³ªÅ­È  ¤ñ¦p A1~A3¦³¸ê®Æ  A4A5ªÅªº A6¦³¸ê®Æ
¦pªG¥ÎUsedRange.rows.count  ·|ºâ¨ì 6
¥ÎCOUNTA¥u·|ºâ¥X 4 (4­Ó¸ê®Æ)

¥t¥~
¦pªGAÄ榳5µ§¸ê®Æ¡ABÄ榳6µ§¸ê®Æ
¦Ó§Ú¤@¦¸¬O­n­pºâ A1:B100  ³o­Ó½d³ò¤º¡A¤w¨Ï¥Î¸ê®Æªº¦C¼Æ
´N¨S¿ìªk¥ÎCOUNTA¤F

©Ò¥H¦pªG¦³­þ¦ì¤j¤j¯à¦³¦nªº¼gªk
¦A³Â·Ð±Ð±Ð§Ú
ÁÂÁÂ
«¢Åo~¤j®a¦n§r

TOP

¥»©«³Ì«á¥Ñ ­ã´£³¡ªL ©ó 2019-9-11 10:09 ½s¿è

Sub TEST()
Dim xF As Range, xE As Range
With [A1:B10]
     Set xE = .Item(.Count)  '©w¦ì«ü©w½d³òªº³Ì«á¤@®æ
     Set xF = .Find("*", After:=xE, SearchOrder:=xlByRows, SearchDirection:=xlPrevious) '±q³Ì«á¤@®æ©¹¤W§ä«DªÅ
     If xE <> "" Then Set xF = xE '­Y³Ì«á¤@®æ«DªÅ, «h¥H¦¹®æ¬°·Ç
End With
MsgBox xF.Row
End Sub


====================

TOP

        ÀR«ä¦Û¦b : ¡i°µ¤Hªº¶}©l¡j¨C¤@¤Ñ³£¬O¬G¤Hªº¶}©l¡A¨C¤@­Ó®É¨è³£¬O¦Û¤vªºÄµ±§¡C
ªð¦^¦Cªí ¤W¤@¥DÃD