i need to copy many files with same date from a folder which contains a lot of files to another folder ?

Recommended Answers

All 3 Replies

List the files in a ListFileBox

Loop through the list checking FileDateTime()

Dim i as Integer
For i = 0 to File1.ListCount
   If FileDateTime(File1.List(i)) = "11/05/2010" Then
      ' Do something here

   End If
Next i

u can use this in between...but modify this first

Set sFileSystemObject = CreateObject("scripting.FileSystemObject")
Set sFileObject = sFileSystemObject.getfile(App.Path & "\" & <filename>)
sFileObject.Copy <newlocation like "D:\> & "\" & <same filename>

Do you need to move the files, or copy the files?

If you need to move them and you were to use purplegerbil's code two posts above use the Name Statement...

Name OldFileName As NewFileName

If you need to copy them, use the FileCopy Statement

FileCopy Source, Destination

Good Luck

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.