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

[µo°Ý] ¦p¦óÃö³¬Execl VBA ¸ß°Ýµøµ¡¡C

[µ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
ericyuan86

§A¦n¡G

   ¤£¥X²{¸ß°Ýµøµ¡¡A§Ú·|¨Ï¥Î¤U¦C»yªk¡A
§A­n¤£­n¥ý¸Õ¸Õ©O¡H
Application.DisplayAlerts = False

TOP

        ÀR«ä¦Û¦b : ½_ÁJµ²±o¶V¹¡º¡¡A¶V·|©¹¤U««¡A¤@­Ó¤H¶V¦³¦¨´N¡A´N­n¶V¦³Á¾¨Rªº¯ÝÃÌ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD