PDA

View Full Version : Copy Paste File Specified in Cell to Another Folder



Surii
07-14-2011, 02:33 AM
:think: Step1 or Step2:-
Source file/folder: I have file names specified in one column A2:A10 and their folder addresses in the corresponding rows in the next column B2:B10.

Step2 or Step3:-
Destination file/folder: I want to copy all these files to another folders (folder addresses specified in column C2:C10).

Step3 or Step1:-
Rename files: Then rename these file names (names that shown in column A2:A10) to other file names specified in their corresponding rows in column D2: D10.

Can either start by copying/pasting then renaming OR renaming the file names before copying and pasting. Can anyone assist me to use VBA Macro in Excel to perform this task? I'm a beginner in VBA and I have no idea how to code this. www--> vbaexpress.com/kb/getarticle.php?kb_id=827 this page should help me but it doesn't work after I changed the source folder and destination folder, and removed all the green comments and run it. A compile error message pops up saying "User-defined type not defined" --> pointing at the codes "objFSO As FileSystemObject" :think: