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

[¤w¸Ñ¨M]¦Û°Ê¿z¿ï°ÝÃD

[¤w¸Ñ¨M]¦Û°Ê¿z¿ï°ÝÃD

¥»©«³Ì«á¥Ñ like_azure ©ó 2011-6-13 11:53 ½s¿è
  1. '¥»µ{§Ç¦Û°Ê¿z¿ïÅU«È¦WºÙ¬°BOTTM, ¤H­û¥N¸¹¬°3ªº¸ê®Æ¿ý
  2. Sub vbaAFilter()
  3. Dim Rng As Range        '¦Û°Ê¿z¿ïµ²ªG½d³ò
  4. Dim theRow As Range     '¦U°Ï°ìªº¸ê®Æ¦C
  5. Dim theArea As Range        '¦U°Ï°ì½d³ò
  6.     With Sheets("Orders")       '¦bOrders¤u§@ªí¤¤
  7.         Set Rng = .UsedRange    '©Ò¦³¸ê®Æ½d³ò
  8.         Rng.AutoFilter Field:=2, Criteria1:="BOTTM"     '¿z¿ï¥XÅU«È¬°BOTTOMªÌ
  9.         Rng.AutoFilter Field:=3, Criteria1:="3"         '¦A¿z¿ï¥X­û¤u¥N¸¹¬°3ªÌ
  10.         '³]©w¿z¿ïµ²ªG½d³ò
  11.         Set Rng = Rng.Resize(Rng.Rows.Count - 1).Offset(1, 0).SpecialCells(xlCellTypeVisible)
  12.     End With
  13.     '¹M¾ú¿z¿ïµ²ªG½d³ò¦UAREA
  14.     For Each theArea In Rng.Areas
  15.         '¹M¾ú¦UAREAªº¦U¦C
  16.         For Each theRow In theArea.Rows
  17.             theRow.Select       '¿ï©w¦¹¦C
  18.             MsgBox theRow.Address       'Åã¥Ü¦¹¦Cªº¦ì§}
  19.         Next
  20.     Next
  21.     Rng.AutoFilter          '¸Ñ°£¦Û°Ê¿z¿ïª¬ºA
  22. End Sub
½Æ»s¥N½X
½Ð°Ý¦U¦ì¤j¤j¡A¤W­±µ{¦¡½X¬O°Ñ¦Òcrdotlin¤j¤jªº½d¨Ò(http://blog.xuite.net/crdotlin/excel/11049893)¡A
¤p§Ì¦b¹B¥Îªº®É­Ô¡A«o¹J¨ì¦pªG¨S¦³²Å¦X¿z¿ï±ø¥óªº®É­Ô¡A
´N·|¦bSet Rng = Rng.Resize(Rng.Rows.Count - 1).Offset(1, 0).SpecialCells(xlCellTypeVisible)³o¦æ·í±¼¡A
¿ù»~°T®§¡G°õ¦æ¶¥¬q¿ù»~'1004' §ä¤£¨ì©Ò­n§äªºÀx¦s®æ

½Ð°Ý¦U¦ì¤j¤j­n«ç»ò¸Ñ¨M³o­Ó°ÝÃD©O¡H
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

¥»©«³Ì«á¥Ñ luhpro ©ó 2011-6-8 22:19 ½s¿è

¦^´_ 1# like_azure
Sub vbaAFilter()
.
.
.
On Error GoTo Skip
    With Sheets("Orders")       '¦bOrders¤u§@ªí¤¤
.
.
.
    End With
    For Each theArea In Rng.Areas
.
.
.
    Next
   
Skip:
    Rng.AutoFilter          '¸Ñ°£¦Û°Ê¿z¿ïª¬ºA
   On Error GoTo 0
End Sub

TOP

Set Rng = Rng.Offset(1, 0).SpecialCells(xlCellTypeVisible)
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

·PÁÂluhpro Hsieh¨â¦ì¤j¤jªº¸Ñµª¡A
»°§Ö¨Ó¥h¸Õ¬Ý¬Ý
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

·PÁ¨â¦ì¤j¤j¡A¤w¸g¸Ñ¨M¤F¡AÁÂÁ¡I¡I
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

½Ð°ÝHsieh¤j¤j¡A¤p§Ì¦³¤@­ÓºÃ°Ý½Ð±Ð¡A
¬°¤°»ò§âResize®³±¼´N¤£·|·í±¼¤F©O??
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

        ÀR«ä¦Û¦b : ¯àµ½¥Î®É¶¡ªº¤H¡A¥²¯à´x´¤¦Û¤v§V¤Oªº¤è¦V¡C
ªð¦^¦Cªí ¤W¤@¥DÃD