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

[µo°Ý] EXCEL VBA¿ï¨ú³¡¤ÀÀx¦s®æ½d³ò-(«ü©wÀx¦s®æ¦V¤U¤Î¦V¥k¦ÜÃä¬É³B)

[µo°Ý] EXCEL VBA¿ï¨ú³¡¤ÀÀx¦s®æ½d³ò-(«ü©wÀx¦s®æ¦V¤U¤Î¦V¥k¦ÜÃä¬É³B)



¦U¦ì«e½ú¤j®a¦n:
¤p§Ì§Æ±æ¦b«ü©w¯S©w½d³òªº°}¦C
¦p¦b¦æ¦C¼Æ¤£ª¾¹Dªº¸ê®Æ¤¤«ü©w¬Y­ÓÀx¦s®æ(¹Ï¨Ò¤¤ªºC2),
¨Ã¦V¤U¤Î¦V¥k«ü©w½d³ò¨ìÃä¬É³B(¥HªÅ¦æ©MªÅ¦C¬°Ãä¬É)
¦p¹Ï¤ù¤¤ªº¨Ò¤l¬°¨Ò
¤p§Ì§Æ±æ table_array(3,2) ¥i¥H¦^¶Ç¤å¦r c

¤p§Ì¥Ø«e¸Õ¹Lªº«ü¥O¦³
(1)    Set table_array = Worksheets("¬Y¤u§@ªí").Range("C2").End(xlDown).End(xlToRight)

(2)   Set table_array = Worksheets("¬Y¤u§@ªí").Range("C2").End(xlDown).Resize(, 2)  

¦ý³£µLªk¦pªG¦p¤p§Ì©ÒÄ@«ü©w¨ì§Ú§Æ±æªº½d³ò...
·Q½Ð°Ý¦U¦ì«e½ú¤£ª¾¹D§Úªºcode ÁÙ¬OÆ[©À¥X¤F¤°»ò°ÝÃD?
©ÎªÌ¬O§Úªºcode»Ý­n°µ¤°»ò¼Ëªº­×§ï¤~¯à«ü©w¨ì§Ú§Æ±æªº°}¦C½d³ò©O?
³Â·Ð¦U¦ì«e½ú¼·ªÅ«ü¾É¤F..!
¦pªG¦³¤å¦r±Ô­z¤£°÷ºë½Tªº¦a¤è¤]½Ð¦U¦ì«e½ú´£¥X¨Ó«ü±Ð
·P¿E¤£ºÉ~~!


P.s. ³o½g¤U¤È¤£¤p¤ßµo¿ùªO µo¨ì¤@¯ë°Ï¤F...@@  ¤£ª¾¹D¦³¨S¦³ªO¤j¥i¥HÀ°§Ú²¾°£¤@¯ë°Ï¨º½g??

¦^´_ 1# junkwei

¸Õ¸Õ¬Ý!!
  1. Sub test()

  2.     last_rows = Selection.SpecialCells(xlCellTypeLastCell).Row
  3.     last_columns = Selection.SpecialCells(xlCellTypeLastCell).Column

  4.     Set table_array = Range(Cells(ActiveCell.Row, ActiveCell.Column), Cells(last_rows, last_columns))
  5.     MsgBox table_array(3, 2)
  6. End Sub
½Æ»s¥N½X

TOP

¦^´_ 2# ashan0418

ÁÂÁÂashan0418«e½úªº«ü¾É!
¤£¹L¤£¦n·N«ä~~¤p§Ì¥i¯àªí¹F¤£°÷ºë½T@@
¤p§Ì©Ò§Æ±æ¸ß°Ýªº¬O¦Û°Ê¿ï¨úrange ªºVBA»yªk
¦Ó¤£¬O¥ý¦b¤u§@ªí¿ï¨ú«á¦A¨Ì·Ó©Ò¿ï¨úªº½d³ò³]©wRange
¦A³Â·Ð«e½ú«ü¾É¤F!
¤Q¤À·PÁÂ~~@@

¤£¹L¤p§Ì¤]±q¨Ó¨S¥Î¹L³oºØ¤è¦¡¿ï¨úrange
¤S¤W¨ì¤F¤@½Ò!
ÁÂÁ«e½úªº«ü¾É^^

TOP

¥»©«³Ì«á¥Ñ ashan0418 ©ó 2014-12-28 19:55 ½s¿è

¦^´_ 3# junkwei

§A¬O«ü­n±qC2¶}©l¨Ã¦V¤U¤Î¦V¥k«ü©w©Ò¦³¸ê®ÆªºRange¶Ü??

­Y¬O±N
Set table_array = Range(Cells(ActiveCell.Row, ActiveCell.Column), Cells(last_rows, last_columns))

§ï¦¨
Set table_array = Range(Cells(3,2), Cells(last_rows, last_columns))

TOP

¦^´_ 4# ashan0418

§Ú±N«e½úªºcode¤p¤p­×§ï¤F¤@¤U:
Set table_array = Range(Cells(2,3), Cells(last_rows, last_columns))
³o¼Ë´N¬O§Ú­nªº¨S¿ù¤F!!
·PÁ«e½ú«ü¾É~~~!!

TOP

        ÀR«ä¦Û¦b : ¥¬¬I¦p¼½ºØ¡A¥HÅw³ß¤ß´þ¼íºØ¤l¡A¤~·|µoªÞ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD