Automate searching and then copying files to a folder using excel

S

SP

Hi

I am looking for a process that will optimize the time and effort.
I have an excel file which contains a list (1000) of file names in its
column "A".

These 1000 files are present in different folders under single folder on the
network drive.
My task is to search one by one files from the network and copy the same
into an output folder.

I understand his will take enormous time & effort to do it manually.

So, I am looking for an automation which can interface the MS excel file
with the windows searching and copying.

Appreciate your help.

Thanks

SP.
 
R

Ron de Bruin

You can use FileCopy in a loop (through the cells in A) and use the cell value in the code instead of a string

Sub Copy_One_File()
FileCopy "C:\Users\Ron\SourceFolder\Test.xls", "C:\Users\Ron\DestFolder\Test.xls"
End Sub

Or

Sub Move_Rename_One_File()
'You can change the path and file name
Name "C:\Users\Ron\SourceFolder\Test.xls" As "C:\Users\Ron\DestFolder\TestNew.xls"
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top