- ©«¤l
- 1
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 7
- ÂI¦W
- 0
- §@·~¨t²Î
- WinXP
- ³nÅ骩¥»
- office 2003
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-10-18
- ³Ì«áµn¿ý
- 2011-10-19
|
[µo°Ý] ¦p¦óÃö³¬Execl VBA ¸ß°Ýµøµ¡¡C
¥»©«³Ì«á¥Ñ ericyuan86 ©ó 2011-10-18 16:54 ½s¿è
·Q½Ð°Ý¤j¤jª©¥D¡A¥H¤U§@ªk¬O³z¹Lºô¸ôºÏºÐ¾÷¤À¨É¸ê®Æªº¡A
¦³A¸òBÀɮסABÀɮ׬°¸ê®Æ¦s©ñÂ\¸mºô¸ôºÏºÐprime°Ï¤º¡AAÀɬ°¥¨¶°±±¨î¶µ¾Þ§@ÀÉÂ\¸msales°Ï¡A
¶×¤J¸ê®Æ¬Ò¥¿±`¡A¦ý¬O·|¦³Ó°ÝÃD¡A´N¬O·íBÀɮ׳Q§O¤H·m¥ý¶}±Ò®É¡AAÀɮפ´¥i°õ¦æ¾Þ§@¶×¤J¦ý¥¼Ãö³¬¡A
Y¬OBÀɮצ¹®ÉÃö³¬«á¡A·|¦bAÀɪºexecl¥X²{"¥Ø«e¥i¥ÎÀÉ®×"ªº¸ß°Ýµøµ¡
(¤º®e¬O'BÀÉ®×.xls'¡A²{¦b¥i¥H³Q½s¿è¡C¿ï¾Ü[Ū¼g]¶}±Ò¥¦¡A¥H«K½s¿è¡C)¡A
·Q½Ð°Ýªº¬O¦p¦óÃö³¬¦¹¸ß°Ýµøµ¡ ©Î Ãö³¬¶×¤J®É©Ò²£¥Íªº¼È¦s¡C...... ÁÂÁ ¡C
===============================================================
Sub ¶×¤JBÀɮ׸ê®Æ¦Ü¥»ÀÉ®×()
Dim MyBook As Workbook, uPath, uFile, j&, Jm&
Set MyBook = ThisWorkbook
uPath = "\\10.40.1.12\PRIME\"
uFile = "BÀÉ®×.xls"
If Dir(uPath & uFile) = "" Then MsgBox "¡°§ä¤£¨ì¡e" & uFile & "¡fÀɮסA½Ð½T»{¡I¡@", 0 + 16: Exit Sub
For j = 1 To Workbooks.Count
If Workbooks(j).Name = uFile Then Jm = 1: Exit For
Next j
Application.ScreenUpdating = False
If Jm = 0 Then Workbooks.Open uPath & uFile
Workbooks(uFile).Sheets("Sheet1").Rows("12:30").Copy MyBook.Sheets("Sheet1").Rows("12:30")
Workbooks(uFile).Close SaveChanges:=False
MsgBox "¡ã¡ã½Æ»s¸ê®Æ§¹¦¨¡ã¡ã¡@"
End Sub |
|