Consulting

Results 1 to 2 of 2

Thread: Copy multiple files from one folder to other using the file names given in excel.

  1. #1

    Copy multiple files from one folder to other using the file names given in excel.

    Hi,

    Can anyone please help me code a macro for the below case:

    I need to take the file names from the excel sheet and copy all the files from a folder to another..

    Thanks.

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Sub Test()
    Dim Source As String, target As String, f
    Source = "C:\Fld1\"
    target = "C:\Fld2\"
    For Each f In Selection
    FileCopy Source & f, target & f
    Next f
    End Sub
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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