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

¿ï©w¬Y­Ó¤£½T©w¼Æ¶qªº½d³òªº»yªk«ç»ò¼g

¿ï©w¬Y­Ó¤£½T©w¼Æ¶qªº½d³òªº»yªk«ç»ò¼g

¤j®a¦n~³Ìªñ¦]¤u§@»Ý¨D¦b¦Û¾ÇEXCEL VBAªº¼gªk ¡A¤w´£¤É¬Y¨Ç·~°Èªº®Ä²v
¤u§@¤W§Ú¦³­Ó»Ý¨D¡A¨C¤é§Ú¥²¶·½Õ¥X«e¤@¤Ñªº¸ê®Æ¡A
µ§¼Æ¤£¤@©w¡A¦³®É­Ô¶È¦³´X¦Ê´X¤Qµ§¡A¦³®É­Ô«o¦³¤W¸Uµ§¡C

ÁöµM§Ú¦³¼g¤@­Ó¬O±Nµ§¼Æ¦Û°Ê§ì¨ì10¸Uµ§¡A¦ý¬O§Ú·Q­n§ó¬ü¤Æ¬ÛÃö¥¨¶°¡C

©Ò¥H·Q­n¼g¤@­Ó¬O¡A¥¨¶°·|¦Û°Ê§ì¨úA2:BX ªº½d³ò¡C BX¬°³Ì«á¤@µ§¸ê®Æ¡A¼Æ¶q¨C¤Ñ³£¤£¤@¼Ë¡C

§Ú¹Á¸Õ¥Î
.End(xlDown)¥h¥NB¦C
©Î¬O¥Î .end(xlDown) »P.offset ªº»yªk¥h¥NA¦C
¤]¹Á¸Õ¥Î Range ("A2: i ") ¡A³]©w for i = (³oÃä§Ú¹Á¸Õ¥Î¤W­±¦n´XºØ¤è¦¡)
³£¬OÅã¥Ü»Pªk¿ù»~¡C

¬Q¤Ñ§Úª¦¤å¬d¤F¤@­Ó±ß¤W¡AÁÙ¬O¬d¤£¥X­ÓÀYºü..
¥i¥H½Ð¤j®a§iª¾§Ú¸Ó¥Î­þºØ»yªk¡AÁÂÁ¤j®a..

¥»©«³Ì«á¥Ñ lpk187 ©ó 2015-7-24 11:11 ½s¿è

¦^´_ 1# woodyliu
§Ú´£¨Ñ¤U¦C¦UºØ¼gªk¡A§A¥ÎF8³v¦æªº°õ¦æ¬Ý¬Ý¡A¦bÆ[¬Ýªº¹Lµ{¤¤½Ð¥´¶}"°Ï°ìÅܼƵøµ¡"¨ÓÆ[¹îÅܼƪºÅܤƷ|§óÁA¸Ñªº
  1. Public Sub Ex()
  2. aa = Cells(Rows.Count, 1).End(xlUp).Row
  3. Range("A1:B" & aa).Select
  4. aa = Cells(Rows.Count, 1).End(xlUp).Address
  5. Range("A1:" & aa).Select

  6. aa1 = Cells(1, 1).End(xlDown).Row
  7. Range("A1:B" & aa1).Select
  8. aa1 = Cells(1, 1).End(xlDown).Address
  9. Range("A1", aa1).Select

  10. bb = Cells(Rows.Count, 2).End(xlUp).Row
  11. Range("A1:B" & bb).Select
  12. bb = Cells(Rows.Count, 2).End(xlUp).Address
  13. Range("A1", bb).Select

  14. bb1 = Cells(1, 2).End(xlDown).Row
  15. Range("A1:B" & bb1).Select
  16. bb1 = Cells(1, 2).End(xlDown).Address
  17. Range("A1", bb1).Select
  18. End Sub
½Æ»s¥N½X

TOP

ÁÂÁ±zªºÀ°¦£~~§Ú¬ã¨s¤@¤UQQ

TOP

¦^´_ 1# woodyliu

¤]¹Á¸Õ¥Î Range ("A2: i ") ¡A³]©w for i = (³oÃä§Ú¹Á¸Õ¥Î¤W­±¦n´XºØ¤è¦¡)
§A¤W­±¬õ¦rªº³¡¥÷»yªk¤]¼g¿ù¦bÂù¤Þ¸¹¤¤(")ªº¦r¬°¦r¦ê¡Ai¬OÅܼơA­n¥Î³sµ²ªº¤è¦¡¨Ó³sµ²¤~¯àŪ¨ìÅܼÆiªº­È
Range ("A2: " & i)³o¸Ìiªº­È¥²¶·¬°Àx¦s®æªº¦ì¸mAddress¡A¬°¦r¦ê
Range ("A2: B" & i)³o¸Ìiªº­È«h¬O¬°¦C¸¹Row¡A¬°¼Æ¦r
¤W­±2ºØ¼gªk¬Ò¥i¡A¥u¬O©w¸qiÅܼƮɤ£¦P½}¤F

TOP

½Ð°Ý~
§Ú¬ÝªO¤W«Ü¦h¤H¦bÅܼƳ£³]©w aa ¡Bbbµ¥~
½Ð°Ý³o®Úª½±µ³]©w i¦³¤£¦P¶Ü?

ÁÙ¬O»¡aa ¡Bbb¨ä¹ê¬O¦³¯S§Oªº§t·N¸ò¥Îªk

TOP

¦^´_ 5# woodyliu


    aa¡Bbb ¥u¬O¤è«K¥´¦r¦Ó¤w¡I
½Ð°Ñ¦ÒVBA¤¤ªº«Å§iÅܼƻ¡©ú

TOP

        ÀR«ä¦Û¦b : §g¤l¬°¥Ø¼Ð¡A¤p¤H¬°¥Øªº¡C
ªð¦^¦Cªí ¤W¤@¥DÃD