Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Paste a file into a folder with the current date
Hi Guys,
I currently have a problem with the following Sub: -------------------------------------------------------------- Sub CopyFiles() 'Create the folder with the current date MkDir "S:\Aat\APA acc\GEOFFROY\CPI Mensuels\ALL APA Positions \Database_" & Format(Date, "yyyymmdd") 'Copy the files created with Olympic Set newDir = "(s:\Aat\APA acc\GEOFFROY\CPI Mensuels\ALL APA Positions \Database_) & Format(Date, "yyyymmdd")))) Dim SourceFile, DestinationFile SourceFile = "Q:\Products\Aat\APA Database\Bonds Database \fapa_bonds.xls" ' Define source file name. DestinationFile = newDir FileCopy SourceFile, DestinationFile ' Copy source to target. End Sub -------------------------------------------------------------- I managed to create the folder with the current date but I can't move the file to the new folder since the line Set newDir = ... gives an error I am a beginner so I dunnot master the "" and the (), so please be nice with me :-) Thanks a lot guys, hope I will help you one day, Mike |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
use current file and folder name | Excel Discussion (Misc queries) | |||
Macro to open most current file in folder | Excel Discussion (Misc queries) | |||
Copy/Paste dates from CSV file - date format error? | Excel Programming | |||
reference to current file path/folder name? | Excel Programming | |||
Copy folder and paste to another folder | Excel Programming |