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

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

[ª©¥DºÞ²z¯d¨¥]
  • GBKEE(2010-6-12 07:18): ¥´¿ù¦r ¥i¦b­ì¤å «ö½s¿è¦A­×§ï§Y¥i ¤£¥²­«·s¦Aµo¤@¦¸¤å

¥»©«³Ì«á¥Ñ ¤Ú§J´µ ©ó 2010-6-13 05:46 ½s¿è

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

sorry,¥´¿ù
cells(65536,1).end(3).row¨ìcells(cells(65536,ActiveCell.SpecialCells(xlLastCell).column).end(3).row


ÁA¸Ñ¤F,¥H«eª©¦n¹³¤£¯à­«½s¿è,©Ò¥H§Ú¤]¨Sª`·N¨ì,¶¶«K´ú¸Õ¤@¤U~

TOP

¦^´_ 10# ¤Ú§J´µ
¸Õ¸Õ¦p Hsieh ªO¥D ©Ò»¡ªº¥Ñ«á©¹«e±À
  1. Sub Ex()
  2. Dim Rng As Range, i&, R&, C&
  3. Set Rng = ActiveSheet.UsedRange
  4. For i = Rng.Columns.Count To 1 Step -1
  5.     If Application.CountA(Rng.Columns(i)) <> 0 Then
  6.         C = Rng.Columns(i).Column
  7.         Exit For
  8.     End If
  9. Next
  10. For i = Rng.Rows.Count To 1 Step -1
  11.     If Application.CountA(Rng.Rows(i)) <> 0 Then
  12.         R = Rng.Rows(i).Row
  13.         Exit For
  14.     End If
  15. Next
  16. If R <> 0 And C <> 0 Then Cells(R, C).Select
  17. End Sub
½Æ»s¥N½X

TOP

¦^´_ 10# ¤Ú§J´µ
  1.    Sub nn()
  2. Set a = Cells.SpecialCells(xlCellTypeConstants).Areas
  3. r = a(a.Count)(a(a.Count).Count).Row
  4. k = UsedRange.SpecialCells(xlCellTypeLastCell).Column
  5. Do Until Application.CountA(Columns(k)) > 0
  6.    k = k - 1
  7. Loop
  8. MsgBox Cells(r, k).Address
  9. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¤u§@ªí¨S¦³­×§ï¥ô¤@Àx¦s®æªº®æ¦¡ «e´£¤U¥i¨Ï¥Î
Sub Ex()
    With ActiveSheet.UsedRange
        .Cells(.Rows.Count, .Columns.Count).Select
    End With
End Sub

TOP

¦^´_ 14# GBKEE

ÁÂÁ¨â¦ìªO¥D¦^ÂÐ
ª©¥D¼gªºµ{¦¡¯u¬Oºë²
Áöª¾¹Da(a.Count)(a(a.Count).Count).Row¬O¬°¤F¨D³Ì¤U¤èrow
¥i¬O¬Ý¤£À´µ²ºc¥Îªk,¬O§_½Ðª©¥D¸ÑÄÀ¤@¤U
¥B­Yrow¥i¥Hª½±µ¨D¥X,¨ºcolumn¬O§_¥i¤ñ·Ó§ä¨ì
§Ú¸ÕµÛ­×§ï¦p¤U,¥i¬Ocolumn·|©¹«e¦h§ä¤@®æ,¥u¦n¥ý¥Îk+1,¤£ª¾¬°¤°»ò??
  1. Sub aa()
  2. Set a = Cells.SpecialCells(xlCellTypeConstants).Areas
  3. r = a(a.Count)(a(a.Count).Count).Row
  4. k = a(a.Count)(a(a.Count).Count).Column

  5. Cells(r, k + 1).Select
  6. End Sub
½Æ»s¥N½X
¥t´úª©¥Dk = UsedRange.SpecialCells(xlCellTypeLastCell).Column¥Îªk®É
·|¦³¿ù»~µo¥Í,½Ð°Ý¥¿½T¥Îªk?
§Ú¥ý§ï¥Îk = ActiveCell.SpecialCells(xlLastCell).Column¥i¥Î
ÁÂÁÂ

TOP

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

¦^´_ 15# ¤Ú§J´µ
Areas ÄÝ©Ê ¶Ç¦^¶°¦X¡A¦¹¶°¦X¥Nªí¦h­«½d³ò¤¤ªº©Ò¦³½d³ò
¦b Set a = Cells.SpecialCells(xlCellTypeConstants).Areas
a=¶°¦X¦h­«½d³ò¤¤ªº©Ò¦³½d³ò
a.Count=­pºâa©Ò¦³½d³ò¤¤¦h­«½d³òªº¼Æ¶q
a(aªº²Ä´X­Ó½d³ò)-->a(a.Count)=a(a¤¤³Ì«á¤@­Ó½d³ò)
a(a¤¤³Ì«á¤@­Ó½d³ò).Count=­pºâa(a¤¤³Ì«á¤@­Ó½d³ò)½d³ò¤¤Cells¼Æ¶q
a(a¤¤³Ì«á¤@­Ó½d³ò)(a(a¤¤³Ì«á¤@­Ó½d³ò).Count)->a(a¤¤³Ì«á¤@­Ó½d³ò)(³Ì«á¤@­ÓCell)
©Ò¥H r = a(a.Count)(a(a.Count).Count).Row ¬O§A­nªº
¥B­Yrow¥i¥Hª½±µ¨D¥X,¨ºcolumn¬O§_¥i¤ñ·Ó§ä¨ì    §ä¤£¨ìªº

a(a.Count) ¤£¤@©w¬O¤u§@ªí³Ì¥kÃ䪺 ½d³ò
a(a.Count) ¤@©w¬O¤u§@ªí³Ì¤U­±ªº½d³ò
¥t´úª©¥Dk = UsedRange.SpecialCells(xlCellTypeLastCell).Column¥Îªk®É

UsedRange ¦p¨S¦³«ü©ú¬O¨º¤@¤u§@ªíªº¤w¥Î½d³ò µ{§Ç¥²¶·¬O¸m©ó§@¥Î¤¤Sheet ªºª«¥ó¼Ò²Õ¤¤  ¨Ò: §@¥Î¤¤ªº¤u§@ªí¬O Sheet1 µ{§Ç½X¶·¸m©ó Sheet1ªºª«¥ó¼Ò²Õ¤¤ ¥i¦æ
§A¥i¯à±N µ{§Ç ¸m©ó¤@¯ë¼Ò²Õ¤¤(Module) ©Î ThisWorkbookª«¥ó¼Ò²Õ¤¤
§A¥²¶·«ü©ú¬O¨º¤@¤u§@ªíActiveSheet.UsedRange ©ÎSheet1.UsedRange

TOP

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


   
­Yrow¥i¥Hª½±µ¨D¥X,¨ºcolumn¬O§_¥i¤ñ·Ó§ä¨ì
  1. Sub Ex()
  2.     Dim Rng As Object, E, R, C
  3.     Set Rng = ActiveSheet.Cells.SpecialCells(xlCellTypeConstants).Areas
  4.     R = Rng(Rng.Count)(Rng(Rng.Count).Count).Row
  5.     For Each E In Rng
  6.         If E(E.Count).Column > C Then C = E(E.Count).Column
  7.     Next
  8.     MsgBox Cells(R, C).Address
  9. End Sub
½Æ»s¥N½X

TOP

ÁÂÁÂGBKEE ª©¥D
¸Ñ»¡±o«Ü²M·¡,§Ú·Q³Ì²×³o¬O³Ì²Å¦X§Úªº»Ý¨D¤F

TOP

¤@¥y·d©w¡C
MsgBox Cells(Cells.Find("*", , , , 1, 2).Row, Cells.Find("*", , , , 2, 2).Column).Address(0, 0)

TOP

        ÀR«ä¦Û¦b : ¬°¦Û¤v§äÂǤfªº¤H¥Ã»·¤£·|¶i¨B¡C
ªð¦^¦Cªí ¤W¤@¥DÃD