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

[µo°Ý] ¦p¦ó½Æ»sªí®æ¨ì§Oªº¤u§@ªí

¦^´_ 4# Hsieh


    ½Ð±Ð¤@¤UHsieh¤j
§Ú·Q¨ì¤@­Ó°ÝÃD,¨º´N¬O¤H¦W¦ü¥G¤£À³ÅV¥Ü¥X¨Ó
©Ò¥H·Q§â«ö¶s·h¨ìªÅ¥Õªº¤u§@ªí2,·Q»¡³o¼Ë´N¤£·|Åý¤H¥Í¬Ý¨ì¦W³æ¦Ó¥i¥H¦b­I´º§@·~
©Ò¥H§â¦¡¤l§ï¦¨
Private Sub CommandButton1_Click()
fs = Application.GetOpenFilename("Excel Files (*.xls), *.xls") '¶}±Ò¥ØªºÀÉ®×
With Workbooks.Open(fs)
  Sheets("sheet1").Columns("B:F").Copy .Sheets("¸ê®Æ½T»{").[B1] '½Æ»s¸ê®Æ
  Sheets("sheet1").Range("J16:K300").Copy .Sheets("¸ê®Æ½T»{").[J16]
End With
End Sub
°õ¦æ«áµ²ªG¥X²{"°}¦C¯Á¤Þ¶W¥X½d³ò",½Ð°Ý§Ú¸Ó«ç»ò­×¥¿©O
jeason

TOP

¦^´_ 4# Hsieh
¦³¤Wºô§ä¨ì¤FGetOpenFilenameªº¥Îªk
·PÁÂHsiehªº«ü±Ð
§Ú¥t¥~§@¤F­×¥¿
­n§âh21ªº¨ìj60ªºÀx¦s®æcopy¨ì¸ê®Æ§¨ªº¦P¤@­Ó¦ì¸m
¤À¨Éµ¹¤j®a
   Range("h21:j60").Copy .Sheets("¸ê®Æ½T»{").[h21]
jeason

TOP

¥»©«³Ì«á¥Ñ Hsieh ©ó 2011-12-1 14:55 ½s¿è

¦^´_ 3# brabus


    fs = Application.GetOpenFilename("Excel Files (*.xls), *.xls")
³o¬O¶}±ÒÂÂÀɪº¹ï¸Ü¤è¶ô¡A¥i¨Ñ¨Ï¥ÎªÌ¿ï¾Ü­n¶K¤W¸ê®ÆªºÀÉ®×
.Sheets("¸ê®Æ½T»{").[B1]
´N¬O³Q¶}±ÒªºÀɮפ¤¸ê®Æ½T»{¤u§@ªíªºB1Àx¦s®æ¡A¤]´N¬O³Q¶K¤W¸ê®Æªº¦ì¸m
¦Ü©ó2­Ó*.xls½Ð°Ñ¾\GetOpenFilenameªºFileFilter ¤Þ¼Æ»¡©ú
FileFilter     ¿ï¾Ü©Êªº Variant¡C¬O«ü©wÀɮ׿z¿ï³W«hªº¦r¦ê¡C
¦¹¦r¦ê¥Ñ¤@Àɮ׿z¿ï¦r¦ê»P MS-DOS ¸U¥Î¦r¤¸ªí¹FªºÀɮ׿z¿ï³W«h´y­z²Õ¦¨¡A¤¤¶¡¥H³rÂI¤À¹j¡C[ÀÉ®×Ãþ«¬] ¤U©Ô¦¡²M³æ¤è¶ô¤¤·|¦C¥X¦U²Õ¦r¦ê¡C¨Ò¦p¡A¤U¦C¦r¦ê«ü©w¨â­ÓÀɮ׿z¿ï¡A¤å¦r©M¼W¯q¶°¡G¤å¦rÀÉ (*.txt),*.txt,¼W¯q¶°ÀÉ®× (*.xla),*.xla¡C
­Y­n¨Ï¥Î¦h­Ó MS-DOS ¸U¥Î¦r¤¸¹Bºâ¦¡²Õ¦¨³æ¤@Àɮ׿z¿ïÃþ«¬¡A¦U¸U¥Î¦r¤¸¤§¶¡»Ý¥H¤À¸¹¤À¹j¡F¨Ò¦p¡A"Visual Basic Files (*.bas; *.txt),*.bas;*.txt"¡C
¦pªG¬Ù²¤¡A«h¦¹¤Þ¼Æ±N¹w³]¬° "All Files (*.*),*.*"¡C
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 2# Hsieh

½Ð°Ý¤@¤UHsieh¤j¤j
§A©Ò»¡ªº"fs = Application.GetOpenFilename("Excel Files (*.xls), *.xls") '¶}±Ò¥ØªºÀÉ®×"
¤W­±³o¬q¬O¤£¬O«üªº¬O¨ú±o²{¦æÀɮתº¸ô®|¶Ü?
¨º2­Ó(*.xls)¬O¤°»ò·N«ä????¤@­Ó¬O²{¦bªº¸ÕºâÀɦW¥t¤@­Ó¬O²Ä¤G­Ó¸Õºâ¶Ü?
¥t¥~  .Sheets("¸ê®Æ½T»{").[B1]«üªº¬Ocopy¨ì"b1"¸Õºâªíªº¸ê®Æ½T»{ªí®æ¶Ü???   
ÁÂÁ§A®@
jeason

TOP

  1. Private Sub CommandButton1_Click()
  2. fs = Application.GetOpenFilename("Excel Files (*.xls), *.xls") '¶}±Ò¥ØªºÀÉ®×
  3. With Workbooks.Open(fs)
  4.   Columns("B:D").Copy .Sheets("¸ê®Æ½T»{").[B1] '½Æ»s¸ê®Æ
  5. End With

  6. End Sub
½Æ»s¥N½X
¦^´_ 1# brabus
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

        ÀR«ä¦Û¦b : §ïÅܦۤv¬O¦Û±Ï¡A¼vÅT§O¤H¬O±Ï¤H¡C
ªð¦^¦Cªí ¤W¤@¥DÃD