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

[µo°Ý] ¦hÄæ¦ìªº¸ê®Æ¦p¦ó¦s¤J°}¦C

[µo°Ý] ¦hÄæ¦ìªº¸ê®Æ¦p¦ó¦s¤J°}¦C

­n±NBÄæ¨ìEÄ檺¸ê®Æ¦s¤J°}¦C¡A¦]¬°¥u¦³¥|Äæ¡A©Ò¥H§Ú¥Î«e½ú±Ðªº¤è¦¡:

ar = Array("B", "C", "D","E")
For i = 2 To .Cells(.Rows.Count, 1).End(xlUp).Row
ReDim Preserve Ay(s) '±N¸ê®Æ¦s¤J°}¦C
Ay(s) = Array(.Cells(i, ar(0)).Value, .Cells(i, ar(1)).Value, .Cells(i, ar(2)).Value, .Cells(i, ar(3)).Value)
s = s + 1

³o¼Ë´N¥i¥H¦s¤J°}¦C¤F¡A¥i¬O¦pªG¦³20¦hÄ檺¸ê®Æ­n¦s¡A«ÜÅãµM³oºØ¤è¦¡·|«Ü²Ö¡A¤£ª¾¸Ó¦p¦ó°µ¤~¦n¡C
ÁÙ¦³·í¸ê®Æ³£²¾Â৹¤F¥H«á¡A¦³¤@¨Ç«D³sÄò©ÊÀx¦s®æªº¸ê®Æ·Q­n§â¥¦§R°£¡A¦p:

With Sheet1
'.[C1].ClearContents
'.[D4].ClearContents
'.[G10].ClearContents
'.[N4:N6].ClearContents
'.[B11:AU12].ClearContents
End With

¦³¨S¦³¿ìªk¥Î°}¦Cªº¤è¦¡Â²¤Æ¤W­±ªºµ{¦¡½X?
Jess

¥»©«³Ì«á¥Ñ Hsieh ©ó 2011-5-22 21:45 ½s¿è

½d³ò¦s¦¨¤Gºû°}¦C
ay = Range([B2], Cells(Rows.Count, 2).End(xlUp).Offset(, 19))Value

¤£³sÄòÀx¦s®æ²M°£
[C1,D4,G10,N4:N6,B11:AU12].ClearContents
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

ÁÂÁÂ Hsieh ¤j¤j
Range([B2], Cells(Rows.Count, 2))
³o¤@¬qµÛ¹ê¬Ý¤£À´¡A·Pı¦n©â¶H¡AÆ[©À¤¤¤@­Ó Range ¬O¥Ñ¤@­Ó"Äæ" + ¤@­Ó"¦C"²Õ¦X¦Ó¦¨¡A¤W­±³o¤@¬q«o¬O¥Ñ¨â²Õ²Õ¦X¦Ó¦¨ªº¡A³o¬O¤°»ò·N«ä¡A¥i¥H±Ð¾É¤@¤U±ß½ú¶Ü?
Jess

TOP

VBAªº»¡©ú
expression.Range(Cell1, Cell2)
expression     ¥²¿ï¡C¸Ó¹Bºâ¦¡©Î·|¶Ç¦^¤W­z¨ä¤¤¤@­Óª«¥ó¡C
Cell1     ¥²¿ïªº Variant¡C½d³ò¦WºÙ¡C³o¥²¶·¬O A1 ¼Ë¦¡°Ñ·Óªº¥¨¶°»y¨¥¡C¸Ó¦WºÙ¤¤¥i¥]¬A½d³ò¹Bºâ¤l («_¸¹)¡B¥æ¶°¹Bºâ¤l (ªÅ¥Õ) ©ÎÁp¶°¹Bºâ¤l (³r¸¹)¡C¤]¥i¥]¬A³f¹ô²Å¸¹¡A¦ý³o¨Ç²Å¸¹¤w³Q©¿²¤¡C±z¥i¥H¦b½d³ò¤¤ªº¥ô¤@³¡¥÷¨Ï¥Î°Ï°ì©w¸q¦WºÙ¡C¦pªG¨Ï¥Î¦WºÙ¡A«h°²³]¸Ó¦WºÙ¨Ï¥Îªº¬O¥¨¶°»y¨¥¡C
Cell2     ¿ï¾Ü©Êªº Variant¡C½d³ò¥ª¤W¨¤©M¥k¤U¨¤ªºÀx¦s®æ¡C¨C¤@°Ñ¼Æ¥i¬°¥]§t³æ­ÓÀx¦s®æ (©ÎªÌ¾ã¦C©Î¾ãÄæ) ªº Range ª«¥ó¡A©ÎªÌ¬°¨Ï¥Î¥¨¶°»y¨¥¬°³æ­ÓÀx¦s®æ©R¦Wªº¦r¦ê¡C

TOP

GBKEE¤j¤j¦n
¨Æ¹ê¤W¡A§Ú¤]±`±`·|¥h§ä»¡©úÀÉ¡A¥i¬O¯u¥¿¯àÂI¶}ªº»¡©ú³sµ²¡A¦n¹³¨S´X­Ó¡Aı±o«Ü©_©Ç¡C

ay = Range([B2], Cells(Rows.Count, 2).End(xlUp).Offset(, 19))Value
¦]¦¹³o¥yªº·N«ä´N¬O¡A±qBÄ檺B2¨ì³Ì«á¤@µ§¸ê®Æ¡A¬O³o­Ó°}¦CªºÀY³¡¡AµM«á¦V¥k19ÄæÂX®i¡C°²³]¬OB2¨ìB6¡A¨º»ò³o­Ó°}¦C´N·|¦s¶i5x20­Ó Cells ªº¸ê®Æ¡A§Ú³o¼Ëªº²z¸Ñ¥¿½T¶Ü?
Jess

TOP

¦^´_ 5# jesscc
¨S¿ù,
½Ðª`·N°}¦Cªº¤¸¯À¬Oª½±µ±q¤u§@ªí¨ú±oªº.°}¦Cªº¥ô¤@ºû³Ì¤p¥i¨Ï¥Îªº°}¦C¯Á¤Þ¬O±q1¶}©l.
¦p:ay = Range([B2], Cells(Rows.Count, 2).End(xlUp).Offset(, 19))Value
ay(1,1)=>[b2]  ¦Ó¤£¬O  ay(0,0)=>[b2].

TOP

ÁÂÁ Hsieh ¤j©M GBKEE ¤jªº¸Ñ»¡!
Jess

TOP

        ÀR«ä¦Û¦b : ÁÀ¨¥¹³¤@¦·²±¶}ªºÂAªá¡A¥~ªí¬üÄR¡A¥Í©Rµu¼È¡C
ªð¦^¦Cªí ¤W¤@¥DÃD