Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Check out this page:
http://www.rondebruin.nl/folder.htm "macrowriter" wrote: This was very helpful... here is what I have sofar... however I can only seem to move one file at a time. how can I change this to move all files in the folder? Sub FileCopyExample() Dim sSourcePath As String Dim sTargetPath As String ' Change these paths to your Source and Target paths. sSourcePath = "C:\PNTTEMPL\CustomDoc\CHARM.PCD" sTargetPath = "C:\PNTTEMPL\CustomDoc\TEST\CHARM.PCD" On Error Resume Next ' Copy the file "My Document" file from "Macintosh HD:Documents" ' to "Macintosh HD:Backup". FileCopy sSourcePath, sTargetPath If Err 0 Then MsgBox Err.Description End Sub "KtM" wrote: You are missing "", ie filecopy "what","to" for example. filecopy "c:\test.xls","c:\test2.xls" or use same method as VBA example and use variables, which makes it easier to change if used repeatedly. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy a folder by macro | Excel Discussion (Misc queries) | |||
Macro to create a folder and copy files | New Users to Excel | |||
How to copy 30 csv files from a folder to another folder | Excel Programming | |||
Macro to copy range from Excel files in folder | Excel Discussion (Misc queries) | |||
Create Folder / Copy Folder / Replace | Excel Programming |