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

¸ê®Æ°Ï°ì¥k¤UÄæ¦ìÀò¨ú

¸ê®Æ°Ï°ì¥k¤UÄæ¦ìÀò¨ú

¦pªþÀÉ,¨Ï¥ÎActiveCell.SpecialCells(xlLastCell).Select ¸ê®Æ°Ï°ì¥k¤UÄæ¦ì,±o¨ìG15Äæ¦ì(¬°­ì¸ê®Æ°Ï°ì)
¦]­ì¸ê®Æ¦³­×§ï,·s°Ï°ì¹ê»Ú¥k¤UÀ³¬°F13
¥i¬OActiveCell.SpecialCells(xlLastCell).Select ¤´¦ÜG15
½Ð°Ý¦p¦óÀò¨úF13,ÁÂÁÂ

Book1.rar (1.9 KB)

SpecialCells(xlLastCell)
°£«D­ì½d³ò¬O³Qclear©Îdelete
´N¬O³s¦P®æ¦¡²M°£
§_«hexcel¤´»{¬°¸Ó½d³ò¤w¨Ï¥Î
¥ÎCurrentRegionÄݩʸոÕ
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2010-6-11 13:07 ½s¿è

¦^´_ 1# ¤Ú§J´µ

SpecialCells(xlLastCell)¥Ã»·¬O¤u§@ªí¤¤¤w¨Ï¥ÎªºÀx¦s®æ¤§³Ì«á¤@­ÓªºÀx¦s®æ
  1. Sub Ex() 'ActiveCell¥u­n¦ì©ó¤@³sÄò½d³ò¤¤
  2.     Dim Rng As Range
  3.     Set Rng = ActiveCell.CurrentRegion
  4.     Rng(Rng.Rows.Count, Rng.Columns.Count).Select
  5. End Sub
½Æ»s¥N½X

TOP

¦^´_  Hsieh

SpecialCells(xlLastCell)¥Ã»·¬O¤u§@ªí¤¤¤w¨Ï¥ÎªºÀx¦s®æ¤§³Ì«á¤@­ÓªºÀx¦s®æ
GBKEE µoªí©ó 2010-6-11 08:17


ÁÂÁ¨â¦ìªO¥D¦^ÂÐ
¥i¬O¬O¤£¬O¥i¥H¤£ºÞActiveCell¦³¨S¦³¦b³sÄò°Ï°ì,³£¥i§ä¨ì¥k¤U¨¤°Ï°ì
§Ú¸ÕµÛ§â¸ê®Æ§Ë±o§ó¶Ã¨Ç,½Ð°Ý¦p¦ó§ä¨ì¥k¤U¨¤¾ï¦â¦ì¸m?
ÁÂÁÂ

Book1.rar (6.29 KB)

TOP

For Each a In Range(Cells.SpecialCells(xlCellTypeConstants).Address)
  If a.Row > r Then r = a.Row
  If a.Column > k Then k = a.Column
Next
MsgBox Cells(r, k).Address
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 4# ¤Ú§J´µ
  1. Sub Ex()
  2.     Dim E As Range, R&, C&
  3.     For Each E In Cells.SpecialCells(xlCellTypeConstants).Areas
  4.         If E(E.Rows.Count, E.Columns.Count).Row > R Then R = E(E.Rows.Count, E.Columns.Count).Row
  5.         If E(E.Rows.Count, E.Columns.Count).Column > C Then C = E(E.Rows.Count, E.Columns.Count).Column
  6.     Next
  7.     Cells(R, C).Select
  8. End Sub
½Æ»s¥N½X

TOP

¦^´_ 6# GBKEE

ÁÂÁ¨â¦ìªO¥D´£¨ÑCells.SpecialCells(xlCellTypeConstants)ªº¥Îªk
¤S¦h¾Ç¤F¤@ºØ¥Îªk,¤@ºØ¬O¥Ñ°Ï°ì¤º¦U«DªÅ¥ÕÄæ¦ì§ä¥X³Ì¥k¤Î³Ì¤U¦ì¸m
¤@ºØ¬O¥Ñ°Ï°ì¤º¦U³sÄò°Ï¶ôªº¥k¤U,³v¤@§ä¥X³Ì¥k¤Î³Ì¤U¦ì¸m,
©ó¤p¸ê®Æ´ú¸Õok,¥i¬O·í§Ú¥Î¨ì¸ê®Æ¦h¥B½ÆÂø°Ï°ì®É
¦]¬°»Ý³vÄæ¦ì¥hÀË´ú¦ì¸m,´N±¾¦b¨º¸Ì
   
¥u¦n¥t·Q¿ìªk,¸ÕµÛ¤]±qSpecialCells(xlLastCell),¦ý±q¥~³¡­Ë§ä¦^¥h
½Ðª©¥D«ü±Ð,ÁÂÁÂ


book1.rar (12.31 KB)

TOP

¦^´_ 7# ¤Ú§J´µ


    ¥Ñ«á©¹«e±À
  1. Sub NN()
  2. Set Rng = Sheet1.UsedRange
  3. r = Rng.Rows.Count
  4. k = Rng.Columns.Count
  5. Do Until Application.CountA(Rng.Columns(k)) <> 0
  6. k = k - 1
  7. Loop
  8. Do Until Application.CountA(Rng.Rows(r)) <> 0
  9. r = r - 1
  10. Loop
  11. MsgBox Cells(r, k).Address
  12. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 8# Hsieh

ÁÂÁÂHsiehª©¥D¦^À³,§Ú¥»¨Ó¤]·Q¨Ï¥Îcounta¨Ó©¹«e±À
¥i¬O¤£·|¨Ï¥Î,²{¦b¤S¾Ç¤F¤@ºØ¥Îªk
³o¤@©«Àò¯q¨}¦h,·PÁÂ

TOP

¦^´_ 9# ¤Ú§J´µ

¤£¹L­è­è¤S·Q¨ì,¥ý«e´ú¸Õ¤]¦³¥Î¹LÃþ¦ü±q¥~©¹¤º§äªº¤èªk
¦ý¦pªG¤]¬O¸ê®Æ²§°Ê¦hªº®É­Ô(ex:±q30000µ§ÅÜ1000µ§)
³o®É­Ô¥Îcounta§ä¨ì«DªÅ¥ÕrowÁÙ¬O¥²¶·§ä29000¦¸
©Ò¥Hı±o­Y­n¾A¦X¦h¸ê®Æª¬ªp
¥i¯àÁÙ¬O±qcells(65536,1).end(3).row¨ìcells(cells(65536,ActiveCell.SpecialCells(xlLastCell).column).row,§ä¨ì³Ì¤jrow
³»¦h¤£·|¶W¹L256¦¸

TOP

        ÀR«ä¦Û¦b : °µ¸Ó°µªº¨Æ¬O´¼¼z¡A°µ¤£¸Ó°µªº¨Æ¬O·Mè¡C
ªð¦^¦Cªí ¤W¤@¥DÃD