| ©«¤l4 ¥DÃD1 ºëµØ0 ¿n¤À7 ÂI¦W0  §@·~¨t²Îwindows7 ³nÅ骩¥»x64 ¾\ŪÅv10 µù¥U®É¶¡2016-1-11 ³Ì«áµn¿ý2021-3-19 
 | 
                
| ¥»©«³Ì«á¥Ñ 882138 ©ó 2016-1-14 11:01 ½s¿è 
 ª©¤j§A¦n~§Ú¦b±z³¡¸¨®æ¦³µo²{¦³Ãþ¦üªºvba,ÀɮצWºÙ¥i¥H§ó§ï¦¨§Ú¿é¤JªºÀɮצWºÙ¶Ü?¦Ó¤£¬O´M§ä¥þ³¡Àɮתº
 ½Æ»s¥N½XSub ½Æ»sÀÉ®×()
Dim y&, MyPath, uPath, CCPath$, xR As Range, uChk1, uChk2
Dim Obj, FName1$, FName2$, FL1, FL2, Date1 As Date, Date2 As Date
y = Cells(Rows.Count, "C").End(xlUp).Row
If y < 8 Then MsgBox "µLÀɮשú²Ó¡A½Ð¥ý°õ¦æ¡e¸ü¤JÀɮסf!": Exit Sub
MyPath = [B1]: If MyPath = "MyPath" Then MyPath = ThisWorkbook.Path
If Right(MyPath, 1) <> "\" Then MyPath = MyPath & "\"
uPath = [D1]: If Right(uPath, 1) <> "\" Then uPath = uPath & "\"
If Dir(uPath, vbDirectory) = "" Then MsgBox "§ä¤£¨ì¡e¥Øªº¸ô®|¡G" & uPath & "¡f¡@": Exit Sub
uChk1 = ActiveSheet.CheckBoxes("¿ï¶µ1").Value
uChk2 = ActiveSheet.CheckBoxes("¿ï¶µ2").Value
'-------------------------------------
Set Obj = CreateObject("Scripting.FileSystemObject")
Range("E7:E" & y).ClearContents
For Each xR In Range("C7:C" & y)
    If xR = "" Then
       If uChk1 = xlOn Then
          CCPath = Replace(xR(1, 2) & "\", MyPath, uPath)
          If Dir(CCPath, vbDirectory) = "" Then MkDir CCPath
          xR(1, 3) = "¡¹"
       End If
       GoTo 101
    End If
    '---------------------------
    CCPath = uPath
    If uChk1 = xlOn Then CCPath = Replace(xR(1, 2), MyPath, uPath)
    FName1 = xR(1, 2) & xR(1, 0):   FName2 = CCPath & xR(1, 0)
    If uChk2 = xlOn And Dir(FName2) <> "" Then
       Date1 = Obj.GetFile(FName1).DateLastModified '×§ï¤é´Á (DateCreated '«Ø¥ß¤é´Á)
       Date2 = Obj.GetFile(FName2).DateLastModified
       If Date1 <= Date2 Then xR(1, 3) = "...": GoTo 101
    End If
    FileCopy FName1, FName2
    xR(1, 3) = "¤w½Æ»s"
101: Next
 Dir ("PP"): Beep
End Sub
 20140928v01(½Æ»s¸ê®Æ§¨ÀÉ®×).rar (23.36 KB) | 
 |