+ Reply to Thread
Results 1 to 7 of 7

File Copy from paths specified in columns.

  1. #1
    Registered User
    Join Date
    12-23-2019
    Location
    Australia
    MS-Off Ver
    365
    Posts
    13

    File Copy from paths specified in columns.

    Hi,

    I am having trouble with VBA code that is intended to Copy from Column A (Named Range: Source_List) to destinations set in Column B (Named Range: Destination_List)

    My current code was adapted of a file copy script, but as I am new to coding I have most likely not addressed the procedure correctly.
    The next stage in the code is to have the msgbox report which files have been moved.

    Any help is greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,002

    Re: File Copy from paths specified in columns.

    Possibly...
    Please Login or Register  to view this content.
    ____________________________________________________________
    If I've been helpful, let me know. If I haven't, let me know that too.

  3. #3
    Registered User
    Join Date
    12-23-2019
    Location
    Australia
    MS-Off Ver
    365
    Posts
    13

    Re: File Copy from paths specified in columns.

    Hi and thank you for the response.

    Unfortunately, the code is returning a runtime error.

  4. #4
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,002

    Re: File Copy from paths specified in columns.

    Can you show the error message and the line of code that highlights with the error?

  5. #5
    Registered User
    Join Date
    12-23-2019
    Location
    Australia
    MS-Off Ver
    365
    Posts
    13

    Re: File Copy from paths specified in columns.

    Hi and thank you for continuing to help.

    Invalid procedure with: .copyfile cell.Value, cell.Offset(, 1).Value, True 'Warning: set to overwrite existing files

  6. #6
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,002

    Re: File Copy from paths specified in columns.

    Try this - again remembering that it will overwrite existing files in the destination folder.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    11-06-2020
    Location
    Slovakia
    MS-Off Ver
    2010
    Posts
    5

    Re: File Copy from paths specified in columns.

    Hi, is there an option to rename file instead of overwriting the file ?
    For example :
    I have files - Test_A.pdf Test_B.pdf .........
    Start macro to copy them, but the Test_B file is already in the destination folder.
    It is possible for the macro to rename the file to "Test_B (2).pdf" or "Test_B (3).pdf" ... (4).pdf ... ( it depends on how many copies are already in the destination folder ) and copy this new renamed file ?

+ 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. [SOLVED] Paste file into multiple folders using a list of file paths
    By sabin348 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-03-2020, 07:41 AM
  2. [SOLVED] Copy and Paste Cell Values between Workbooks on Separate File paths
    By oloyejawnson in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-07-2018, 09:05 AM
  3. About file paths
    By Moragtao in forum Excel General
    Replies: 1
    Last Post: 07-19-2017, 05:10 AM
  4. VBA Go down list of file paths, open, and copy specific cells from each
    By b.frost in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-05-2015, 07:25 AM
  5. Linked File Paths Change When File is Moved
    By belewfripp in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-06-2013, 12:18 PM
  6. Export To Inf file & Zip the Files from the given file paths picking every 10 rows
    By vivekhalder in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-18-2012, 03:59 AM
  7. file paths
    By hr in forum Excel General
    Replies: 0
    Last Post: 12-07-2005, 01:10 PM

Tags for this Thread

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