Hello,
I found this great code which copies files to another folder:.. found here: http://www.rondebruin.nl/folder.htm
Sub Copy_Folder()
'This example copy all files and subfolders from FromPath to ToPath.
'Note: If ToPath already exist it will overwrite existing files in this folder
'if ToPath not exist it will be made for you.
Dim FSO As Object
Dim FromPath As String
Dim ToPath As String
FromPath = "C:\Temp_Folder1" '<< Change
ToPath = "C:\Temp_Folder2" '<< Change
'If you want to create a backup of your folder every time you run this macro
'you can create a unique folder with a Date/Time stamp.
'ToPath = "C:\TempFolder\" & Format(Now, "yyyy-mm-dd h-mm-ss")
If Right(FromPath, 1) = "\" Then
FromPath = Left(FromPath, Len(FromPath) - 1)
End If
If Right(ToPath, 1) = "\" Then
ToPath = Left(ToPath, Len(ToPath) - 1)
End If
Set FSO = CreateObject("scripting.filesystemobject")
If FSO.FolderExists(FromPath) = False Then
MsgBox FromPath & " doesn't exist"
Exit Sub
End If
FSO.CopyFolder Source:=FromPath, Destination:=ToPath
MsgBox "You can find the files and subfolders from " & FromPath & " in " & ToPath
End Sub
Is it possible to modify this somewhat?
The files i'd like to copy are part of an animation sequence. (1000 frames long)
ie:
Image_0000.jpg
Image_0002.jpg
Image_0003.jpg
Image_0004.jpg
etc..
What I'd like to do is add a line which designates a numerical value amount to copy. (every 40 frames)
ie:
to copy files 0 - 40 to C:\Folder1
files 41 - 80 to C:\Folder2
files 81 - 120 to C:\Folder3
etc.
Is this possible?
Thanks for any help.
Jeff
Bookmarks