+ Reply to Thread
Results 1 to 4 of 4

copy image file from one folder to another based on a list

  1. #1
    Registered User
    Join Date
    08-18-2015
    Location
    Birmimgham
    MS-Off Ver
    2015
    Posts
    78

    copy image file from one folder to another based on a list

    I have a sheet that lists image file names in column A. I would like a macro to read each cell for the image file name e.g. images.jpg, copy it from c:\images1 to c:\images2. Thanks in advance!

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: copy image file from one folder to another based on a list

    Hello San75,

    This worked in my tests. If your files don't start on row 1 in column "A", change the variable RowBeg to the starting row.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    08-18-2015
    Location
    Birmimgham
    MS-Off Ver
    2015
    Posts
    78

    Re: copy image file from one folder to another based on a list

    Hi Leith Ross. Thanks for the code. I need a slight modification. The list is located in a workbook that has a sheet called images. The first row will have a header so it needs to start at row 2. In my test it did do a file copy however the file size of the file copied was zero bytes. I also need it to skip any files that are already in the images2 folder and overwrite files where if the source file is a difference size. Thanks again.

  4. #4
    Registered User
    Join Date
    08-18-2015
    Location
    Birmimgham
    MS-Off Ver
    2015
    Posts
    78

    Re: copy image file from one folder to another based on a list

    Got it to work. I had missed out the "\" after the directory.

    It failes when an image file is not present. Can you please add a skip if not found code too?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Copy Files from One Folder to Another Folder based on a List In Excel
    By civram1982 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-21-2019, 06:34 AM
  2. [SOLVED] Copy the file in your list and then move to the new folder
    By misteyoso in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 03-01-2017, 03:24 AM
  3. Replies: 4
    Last Post: 10-21-2016, 05:33 PM
  4. Replies: 1
    Last Post: 10-19-2016, 04:44 PM
  5. Copy Files from one folder to different folders based on pdf file name
    By jtammyg in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-23-2014, 11:49 AM
  6. copy file to new folder based on cell value and display message box
    By kboy1289 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-05-2013, 03:38 PM
  7. search for a file in a folder based on data, copy and paste it in another folder
    By kboy1289 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2013, 11:47 AM

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