Hi
I would like to copy file to a new folder in the C drive and rename it
ex.
c:/Folder/file.txt
Where Folder is not created before, I would like to create it then copy that file to that folder.
You will need to use the Dir Function to test if the directory exists and use the MkDir Statement to create the directory if it does not. Then you can use the FileCopy Statement to copy [rename] the file. Check the help files for these functions for more info and examples...
Dim mydir As String
mydir = Dir("c:\mydata", vbDirectory)
If Len(mydir) <> 0 Then
MsgBox "This directory exists."
Else
MsgBox "This directory doesn't exist."
End If