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

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

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

¥»©«³Ì«á¥Ñ brabus ©ó 2011-12-3 21:48 ½s¿è

¦pªþ¥ó¬¡­¶Ã¯1¤¤©Ò¥Ü
§Ú·Q¦b«ö¤U¦P¨B«ö¶s«á
§â¬¡­¶Ã¯1Àx¦s®æ¤¤b1¨ìd87ªº¸ê®Æ
½Æ»s¨ì¬¡­¶Ã¯2¤¤ªº"¸ê®Æ½T»{"¨º±i¤u§@ªíªºb1¨ìd87Àx¦s®æ(¥¼¨Ó¦pªG¸ê®Æ¼W¥[ªº¸Ü,­n¥i¥H¥þ³¡½Æ»s,¤£¹L¥u·|¥Î¨ìb¨ìdªº3­ÓÄæ¦ì)
²{¦b¬¡­¶Ã¯2¤¤ªº"¸ê®Æ½T»{"¤u§@ªí³Q"ÁôÂÃ"vba ªº±K½X¬Otwbts
¥ý¤£¦Ò¼{¬¡­¶Ã¯1¤¤ªº¸ê®Æªº¤º®e,¦]¬°¨ì®É·|key¤J¥¿½T¸ê®Æ
­n¦Ò¶qªº¬O³o2­ÓÀÉ¥i¯à©ñ¦b¥ô¤@ºÏºÐ¤¤
¤£­­¬O¦b®à­±©Î¬O"§Úªº¤å¥ó"¤¤,¥i¯à¦bd¼Ñ©Îe¼Ñ......
¥¼¨Ó¤]¥i¯à­n¦P®É¦s¨ì¬¡­¶Ã¯3¤¤ªºb¨ìdÄæ....
½Ð°ª«ü¾É¤@¤U­n«ç»ò¼gvba

¬¡­¶Ã¯2.rar (5.53 KB)

¬¡­¶Ã¯1.rar (11.07 KB)

jeason

  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

¦^´_ 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

¥»©«³Ì«á¥Ñ 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

¦^´_ 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

¦^´_ 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

¦^´_ 6# brabus
§â«ö¶s·h¨ìªÅ¥Õ¤u§@ªí2
¨º³o­ÓªÅ¥Õ¤u§@ªí2¬O§_»P­n½Æ»sªº¨Ó·½¤u§@ªí¦b¦P¤@­ÓÀɮשO?
´N¬OSheets("sheet1")¬O§_¦s¦b?
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 7# Hsieh


    §A¦n§Ú¤v¸g­×¥¿ªþ¥ó¬¡­¶Ã¯1¤F
§Ú¤W¦¸°Ýªº¬O¦b¬¡­¶Ã¯1ªº¤u§@ªí1³]«ö¶s
§â¸ê®Æcopy¨ì¬¡­¶Ã¯2³o­ÓÀɮפWªº"¸ê®Æ½T»{"¤u§@ªí¤¤
²{¦b·Q§â¤u§@ªí1³o­Ó«ö¶s²¾¨ì¦P¬¡­¶Ã¯ªº¤u§@ªí2¤W
¦]¬°¤£·QÅý¤H¬Ý¨ì¤u§@ªí1¤Wªº¤H¦W¸ê®Æ
·Q¦b¤u§@ªí2¤W«ö«ö¶s,´N¥i¥H§¹¦¨¤W­±­ì¨Ó©Ò»¡ªº½Æ¨îªº¤u§@
ÁÂÁ§A
jeason

TOP

¦^´_ 8# brabus
"°}¦C¯Á¤Þ¶W¥X½d³ò"
ªº­ì¦]À³¸Ó¬O¦]¬°¤u§@ªí¤£¦s¦b
§AÀˬdÀɮ׬ݬݧAªº¤u§@ªí¦WºÙ¬O§_¥¿½T
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 9# Hsieh

Àɮצs¦b°Ú,
§Ú¸ÕµÛ½Õ¾ã¤F¤@°}¤l
,²{¦b°õ¦æ«á¥X²{With Workbooks.Open»yªk¿ù»~
§Ú§â·sÀɤW¶Ç¤F
½Ð±zÀ°§Ú¬Ý¸Ó«ç»ò½Õ¾ã­×¥¿
ÁÂÁÂ

¬¡­¶Ã¯1.rar (11.78 KB)

¬¡­¶Ã¯2.rar (3.57 KB)

jeason

TOP

        ÀR«ä¦Û¦b : ¦³¤ß´N¦³ºÖ¡A¦³Ä@´N¦³¤O¡A¦Û³yºÖ¥Ð¡A¦Û±oºÖ½t¡C
ªð¦^¦Cªí ¤W¤@¥DÃD