+ Reply to Thread
Results 1 to 3 of 3

copy particular files to folder according to excel list

  1. #1
    Registered User
    Join Date
    05-28-2012
    Location
    Vilnius
    MS-Off Ver
    Excel 2021
    Posts
    23

    copy particular files to folder according to excel list

    Hello,

    I have cells (A1:A50) named with 8 digit number each.

    Also, I have database (~400 files) in c:\files. They are named with 8 digit number with prefix .xls. For example 12345678.xls 25687452.xls

    I need a macro which can find those 50 files (from A1 till A50) in all database and copy them elsewhere (let's say c:\selected).

    Hope it's clear enough and sorry for my bad English.

    Thank you very much for your help.
    Tomas

  2. #2
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: copy particular files to folder according to excel list

    Edit: This copies all file in a folder. I will need to incorporate the selected files from range.

    Something like this should work (it tested successful on my side).

    Please make a copy of your workbook and test on the copy.

    Please Login or Register  to view this content.
    Perhaps it was the Noid who should have avoided me...
    If you are satisfied with my solution click the small star icon on the left. Thanks
    1. Make a copy of your workbook and run the following code on your copy (just in case)
    2. With excel open, press ALT+F11 to open the Visual Basic Editor (VBE). From the "Insert" menu, select "Module".
    3. Paste the code from above into the empty white space. Close the VBE.
    4. From the developer tab, choose "Macros", select the Sub Name, and click "Run".

  3. #3
    Registered User
    Join Date
    05-28-2012
    Location
    Vilnius
    MS-Off Ver
    Excel 2021
    Posts
    23

    Re: copy particular files to folder according to excel list

    Thank you for quick answer.

    This code copy all files from "FromPath" to "ToPath".

    I need that this code copy files only according to filenames mentioned in A column.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1