Here is one way:
VB Code:
Public Sub CopyAllFiles(strSourceFolder As String, _
strDestFolder As String, _
Optional sBeginsWith As String, _
Optional sContains As String, _
Optional sEndsWith As String, _
Optional sExt As String)
'=========================================================
Dim strFile As String
On Error GoTo ErrClear
If Not Right(strSourceFolder, 1) = "\" Then strSourceFolder = strSourceFolder & "\"
If Not Right(strDestFolder, 1) = "\" Then strDestFolder = strDestFolder & "\"
strFile = Dir(strSourceFolder, vbNormal)
Do While strFile <> ""
If strFile <> "." And strFile <> ".." Then
If Not Trim(sBeginsWith) = "" Then
If UCase(Left(strFile, Len(Trim(sBeginsWith)))) = UCase(Trim(sBeginsWith)) Then
FileCopy strSourceFolder & strFile, strDestFolder & strFile
End If
End If
End If
strFile = Dir
Loop
Exit Sub
ErrClear:
'-----------
Err.Clear
Resume Next
End Sub
Sample from above will work to some extent but KIM that you may need to modify it ...
Good luck