December 5, 2016
In our root directory for example D:\ We have numerous Folders which store Excel Files by category. How to write a macro to search each folder from the root directory, move or copy the Excel files to an external hard disc or an USB drive without using the manually move or copy and paste process.
I think macro can ensure completeness in the excel files move and copy process...
October 5, 2010
Hi David,
Use xcopy from the Command Prompt - much easier as it already exists.
I assume you are using Windows. Click on the Start/Windows button in the bottom left of the screen. Type cmd and the Command Prompt app should be shown. Click on it to open a Command Prompt window.
Type xcopy /? to see the help info for xcopy.
To copy files from D:\ and all subfolders, to the U: drive, you'll want to use a command like this
xcopy d:\*.xls* u:\ /s /c /i /r /y
Double check the command switches to make sure they do what you want.
Regards
Phil
October 5, 2010
Hi David,
If you type xcopy /? in the Command Prompt you get all the help info for xcopy that tells you what the switches do.
/s Copy directories and sub-directories except empty ones
/c Continue copying if an error occurs
/i If the destination does not exist and copying more than one file, assume the destination is a directory
/r Overwrite read only files
/y Do not prompt to confirm overwriting of an existing fie in the destination.
Cheers
Phil
1 Guest(s)