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

¿z¿ï¤@°Ý

¿z¿ï¤@°Ý

½Ð°Ý¸g¿z¿ï¥X¨Óªº¸ê®Æ¡A¦p¦ó±oª¾¨C¤@¦Cªº¦s®æ¦ì¸m¤Î¦p¦ó²¾°Ê´å¼Ð¨ì«ü©wªº¬Y¤@¦C? ÁÂÁÂ

°²³]ªí¦b A1:C6
¿z¿ï«á, ¹B¥H¤Uªº,·|§â¦æ¼Æ¤@¦æ¤@¦æŪ¥X¨Ó. ¯d·N¤U­±¥u¿ï¤@­ÓÄæ.
    For Each area In Range("A1:A6").SpecialCells(xlCellTypeVisible).Areas
        For Each cell In area
            MSGBOX(cell.Row)
        Next
    Next
À´±oµo°Ý,µª®×´N·|¦b¨ä¤¤

¤µ¤éの¤@¬íは  ©ú¤éにない
http://kimbalko-chi.blogspot.com
http://kimbalko.blogspot.com

TOP

ª©¤j±z¦n¡A¤p§Ì¤]¹ï¦Û°Ê¿z¿ï¦³«Ü¦hºÃ´b¡A­n½Ð±Ð¦U¦ì¤j¤j¡G
1.½Ð°Ý¤U­±¨º­ÓFor Each cell In area
                              "Cell" -->¬O«O¯d¦r¡AÁÙ¬O¦Û©wªºÅܼƩO?
2.¦pªG§Ú¤w¸g¼g¤@¬qµ{¦¡¡]¦p¤U)¬O¤@¦C¦CŪ¨úªº®É­Ô¡A­n«ç»ò§PÂ_¿ï¨ú¨ìªº¨º¤@¦C¡A¬O¤£¬O¦³¸ê®Æ©O(§Ú¦³¥Î¹LIs Nothing¡A¦ý¬O¨S¦³§@¥Î)?
3.­n«ç»òŪ¨ú¨C¤@¦C¸Ì­±ªº¯S©wÄæ¦ì©O?


Dim rng As Range        '¦Û°Ê¿z¿ïµ²ªG½d³ò
Dim theRow As Range     '¦U°Ï°ìªº¸ê®Æ¦C
Dim theArea As Range        '¦U°Ï°ì½d³ò

For Each theArea In rng.Areas
        '¹M¾ú¦UAREAªº¦U¦C
        For Each theRow In theArea.Rows
            theRow.Select       '¿ï©w¦¹¦C
            'MsgBox theRow.Address       'Åã¥Ü¦¹¦Cªº¦ì§}
        Next
    Next
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¦^´_ 3# like_azure
  1. For Each theArea In rng.Areas
  2.         '¹M¾ú¦UAREAªº¦U¦C
  3.         For Each theRow In theArea.Rows
  4.             theRow.Select       '¿ï©w¦¹¦C
  5.             MsgBox theRow.Cells(1).Address                  'Åã¥Ü¦¹¦C²Ä1Ä檺¦ì§}
  6.             MsgBox theRow.Cells(theRow.Count).Address       'Åã¥Ü¦¹¦C³Ì«á1Ä檺¦ì§}
  7.         Next
  8.     Next
½Æ»s¥N½X

TOP

·PÁÂGBKEEª©¤jªº¦^ÂÐ
¤p§Ì´ú¸Õ¤§«áµo²{
Åã¥Ü¸Ó¦C³Ì«á¤@¦æªº¦a¤è»Ý­n­×§ï¤@­Ó¤p¦a¤è¤~¯à¦¨¥\
MsgBox theRow.Cells(theRow.Cells.Count).Address
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

        ÀR«ä¦Û¦b : ¤@­Ó¯Ê¤fªºªM¤l¡A¦pªG´«¤@­Ó¨¤«×¬Ý¥¦¡A¥¦¤´µM¬O¶êªº¡C
ªð¦^¦Cªí ¤W¤@¥DÃD