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

¦p¦óÅã¥Ü½d³ò¤¤¥k¤U¨¤Àx¦s®æ¦ì¸m

¦p¦óÅã¥Ü½d³ò¤¤¥k¤U¨¤Àx¦s®æ¦ì¸m

¦pªG³]©w¤F¦WºÙ TEMP = Range("A1:E10")
¥i¥H¥Îrange("temp").row ©Î range("temp").column ª¾¹D¥ª¤W¨¤Äæ©Î¦C¦ì¸m
¦ý­YªG·Qª¾¹D¥k¤U¨¤¦ì¸mÀ³¸Ó¦p¦ó
½Ð¦h¦h«ü±Ð

¦^´_ 1# enoch
  1. Option Explicit
  2. Sub Ex()
  3.     Dim Temp As Range
  4.     Set Temp = Range("A1:E10")
  5.     With Temp
  6.     'With Range("A1:E10")
  7.         MsgBox .Cells(1, 1).Address                             '¥k¤W¨¤
  8.         MsgBox .Cells(1, .Columns.Count).Address                '¥ª¤W¨¤
  9.         MsgBox .Cells(.Rows.Count, 1).Address                   '¥k¤U¨¤
  10.         MsgBox .Cells(.Rows.Count, .Columns.Count).Address      '¥ª¤U¨¤
  11.     End With
  12. End Sub
½Æ»s¥N½X

TOP

¦hÁÂGBKEE ±Ð¾É, ¾Ç·|¤F¥ÎColumns.count
¥t¥~½Ð°Ý .specialcells(xlcelltypelastcell) ¥i¥H¶Ç¦^«ü©w½d³ò³Ì¤S¤U¨¤¶Ü?
¸Õ¹L¥u¯à¶Ç¦^¤u§@ªí³Ì¤S¤U¨¤¦ì¸m

TOP

¦^´_ 3# enoch


    .specialcells(xlcelltypelastcell) ¬O¶Ç¦^¤u§@ªí¤º©Ò¦³¸ê®Æªº³Ì¥k¤U¨¤Àx¦s®æ
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-2-4 16:37 ½s¿è

¦^´_ 3# enoch
.specialcells(xlcelltypelastcell) ¥i¥H¶Ç¦^«ü©w½d³ò³Ì ¤S¤U¨¤¶Ü ?  
µ¥¦P¶Ç¦^UsedRange½d³ò³Ì¥k¤U¨¤
  1. Sub Ex()
  2.     With ActiveSheet
  3.         MsgBox .Cells.SpecialCells(xlCellTypeLastCell).Address
  4.         With .UsedRange
  5.             MsgBox .Cells(.Rows.Count, .Columns.Count).Address
  6.         End With
  7.     End With
  8. End Sub
½Æ»s¥N½X

TOP

function iLastCell(R) as Range
    set iLastCell=R.cells(R.cells.count)
end function
lmh

TOP

        ÀR«ä¦Û¦b : ¤f»¡¦n¸Ü¡B¤ß·Q¦n·N¡B¨­¦æ¦n¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD