Activate»POpenªº®t§O¸òWindowsªº©w¸q
- ©«¤l
- 44
- ¥DÃD
- 14
- ºëµØ
- 0
- ¿n¤À
- 58
- ÂI¦W
- 0
- §@·~¨t²Î
- Window 8
- ³nÅ骩¥»
- 2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2015-8-15
- ³Ì«áµn¿ý
- 2017-4-18
|
Activate»POpenªº®t§O¸òWindowsªº©w¸q
½Ð°Ý¦U¦ì¤j¤j¡A¦³¨âÓ°ÝÃD·Q½Ð±Ð¡A
°ÝÃD¤@
¶}±Ò¬¡¶Ã¯ªº®ÉÔ¡Aµ{¦¡»y¨¥¤À§O¬°Windows("»s§@¼t°Ó©ú²Óªí.xlsm").Activate ¸òWindows("»s§@¼t°Ó©ú²Óªí.xlsm").Open
ªº®t²§?
°ÝÃD¤G
Workbooks.Open "C:\Users\Andy\Desktop\VBAµ{¦¡½X¬ö¿ý¥»\»s§@¼t°Ó©ú²Óªí\Á`¤½¥q¸ê®Æ.xlsm"
¸ò
Windows("»s§@¼t°Ó©ú²Óªí.xlsm").Activate
«áªÌ¡A¡A§Úªº²z¸Ñ¬O»¡¥un³o¥x¹q¸£¦³¦¹¬¡¶Ã¯¦WºÙ(»s§@¼t°Ó©ú²Óªí)¡A«K¶}±Ò§@·~¡C
ÀuÂI¤W¡A¥iŪ©Ê¤ñ«eªÌ°ª¡C¨º¦Ü©ó«eªÌ¡A¬O¤°»ò±¡ªp¤U·|¥Î¨ì©O?
¨âÓ°ÝÃD¡A·Q½Ð±Ð¤j¤j¡A·Q¤F¨âÓ§«ô¡AÁÙ¦bW´o¦p¦ó±qB¬¡¶Ã¯½Æ»s¨ìA¬¡¶Ã¯¡C¡C¡C¡CÃø¹L¡C.. |
|
|
|
|
|
|
- ©«¤l
- 835
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 915
- ÂI¦W
- 16
- §@·~¨t²Î
- Win 10,7
- ³nÅ骩¥»
- 2019,2013,2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-3
- ³Ì«áµn¿ý
- 2024-11-14
|
½Ð°Ý¦U¦ì¤j¤j¡A¦³¨âÓ°ÝÃD·Q½Ð±Ð¡A
°ÝÃD¤@
Windows.Activate »P Workbooks.Open ªº®t²§?
¾Ç¨ì¦Ñ¦º µoªí©ó 2016-3-27 12:27
èè§Ú¸Õ°µ«á,±o¥Xµ²½×¦p¤U: (¸Õ°µÀô¹Ò: Excel 2000ª©¥»)
º¥ý
Windows("»s§@¼t°Ó©ú²Óªí.xls").Activate
Y "»s§@¼t°Ó©ú²Óªí.xls" ¬¡¶Ã¯©|¥¼Åª¤J°O¾ÐÅ餤®É,
·|¥X²{¿ù»~°T®§ :
°}¦C¯Á¤Þ¶W¥X½d³ò
¦]¬°¦b¤w¶}±Òªº ¬¡¶Ã¯ª«¥ó¸s²Õ ¤¤§ä¤£¨ì¦³¦¹¦WºÙªº¬¡¶Ã¯. (¥i¦b§Y®É¹Bºâµøµ¡¥Î for each a in Workbooks:debug.Print a.name:next ¨ú±o°O¾ÐÅé²{¦³¬¡¶Ã¯¦WºÙ¦Cªí)
µM¦Ó
Workbooks.Open "C:\Users\Andy\Desktop\VBAµ{¦¡½X¬ö¿ý¥»\»s§@¼t°Ó©ú²Óªí\Á`¤½¥q¸ê®Æ.xlsm"
«h¬O¨ì «ü©wªº¥Ø¿ý(Y°Ñ¼Æ¦³§t¸ô®|) ©Î¬O ¥Ø«eªº¥Ø¿ý(¥i¥Î Curdir ¨ú±o) §ä¨ì¸ÓÀɮ׶}±Ò¨Ã³]¬° °µ°Ê¤¤,
¦ýY¦¹Àɮפw¦s¦b°O¾ÐÅ餤«h·|¸ß°Ý¬O§_nÃö³¬¦A«¶}¸ÓÀÉ®×.
·N§Y Activate ¬O¦b "°O¾ÐÅ餤" §ä¨ìª«¥ó(¹ï¶H¤£¬¡¶Ã¯)¨Ã³]¬° °µ°Ê¤¤,
¦Ó Workbooks.Open ¬O¦b "µwºÐ¤¤" §ä¨ìÀÉ®×(¥u¯à¬OExcelÀÉ®×)¨Ã³]¬° °µ°Ê¤¤,
©Ò¥HYÀÉ®×¥¼¶}«hÀ³¥Î Open ¶}±Ò, §_«hÀ³¥Î Activate ³]¬° °µ°Ê¤¤.
¦p¦ó±qB¬¡¶Ã¯½Æ»s¨ìA¬¡¶Ã¯
1. ¥ý¶}±Ò¤@Ó¬¡¶Ã¯,¦A±q¸Ó¬¡¶Ã¯¤¤¥Î Workbooks.Open ¶}±Ò¥t¤@Ó¬¡¶Ã¯.(YÓ§O¤â°Ê¶}±Ò¦³¥i¯à¤¬¬Û¬Ý¤£¨ì)
2. °õ¦æ¤U¦C«ü¥O :
Workbooks("¨Ó·½ÀÉ®×.xls").Sheets("n«þ¨©ªº¤u§@ªí").Copy Before:=Workbooks("¥ØªºÀÉ®×.xls").Sheets(Sheets.Count) |
|
|
|
|
|
|
- ©«¤l
- 8
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 8
- ÂI¦W
- 0
- §@·~¨t²Î
- Window7
- ³nÅ骩¥»
- Office2007
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2016-3-18
- ³Ì«áµn¿ý
- 2024-4-11
|
¦^´_ 1# ¾Ç¨ì¦Ñ¦º
²³æªº»¡Open¬O±qÀx¦s¸Ë¸m¤¤¶}±Ò¬¡¶Ã¯¡AActivate«h¬O±q¤w¶}±Òªº¬¡¶Ã¯(¦Ü¤Ö2Ó©Î¥H¤W)¤¤¿ï¾ÜþÓ¬¡¶Ã¯¬°§@¥Î¤¤¡C
¦¨¬°§@¥Î¤¤ªº¬¡¶Ã¯«á¡A±µ¤U¨ÓªºÄÝ©Ê¡Bª«¥ó...µ¥¾Þ§@¡A¥u°w¹ï§@¥Î¤¤ªº¬¡¶Ã¯¡C
¥t¥~(°ÝÃD¤@)¸Ì±¨Ã¨S¦³Windows("»s§@¼t°Ó©ú²Óªí.xlsm").Open³oºØ»yªk¡C |
|
¬°¦ónÓ¤Hñ¦W
|
|
|
|
|