Hello Firefly,
After you get your date from the InputBox, call this macro. It will open the Open File dialog using the folder path you provide. The user can then select the file to be copied and renamed.
Sub CopyRenameFile(Search_Folder As String, NewFileName As String)
Dim OldDir As String
Dim FSO As Object
Dim NewFileName As String
Dim OldFileName As String
OldDir = CurDir()
ChDir (Search_Folder)
OldFileName = Application.GetOpenFilename("Excel Files, *.xls;*.xla;*.xlt")
If OldFileName = "" Then Exit Sub
Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.CopyFile OldFileName, NewFileName
ChDir (OldDir)
End Sub
Example:
CopyRenameFile "C;\My Documents\Excel Files", "04-23-2007 Excel File.xls"
Sincerely,
Leith Ross
Bookmarks