|
Sub Limonet()
Dim M1%, M2%, D1%, D2%, FileName As Variant, F As Object
M1 = Month([C2].Value)
M2 = Month([C4].Value)
D1 = Day([C2].Value)
D2 = Day([C4].Value)
MkDir ThisWorkbook.Path & "\BOSS的新资料准备"
With CreateObject("scripting.filesystemobject")
For Each F In .getfolder(ThisWorkbook.Path).Files
If Not F.Name Like "*TEST*" Then
FileName = Split(Split(F.Name, ".")(0), "-")
If FileName(0) >= M1 And FileName(0) <= M2 And FileName(1) >= D1 And FileName(1) <= D2 Then
.Copyfile F.Path, ThisWorkbook.Path & "\BOSS的新资料准备\"
End If
End If
Next F
End With
End Sub |
|