+ Reply to Thread
Results 1 to 7 of 7

Paste file into multiple folders using a list of file paths

  1. #1
    Registered User
    Join Date
    02-25-2014
    Location
    Grand Rapids, MI
    MS-Off Ver
    Excel 2013
    Posts
    26

    Paste file into multiple folders using a list of file paths

    I have a list of 400 folder paths in a spreadsheet and I have to paste a worksheet into each one of those folders. I can find all kinds of help to paste to one folder at a time or to search a directory and paste into all folders and sub-folders, but nothing that works from a list. Not sure if matters but it's all in Excel 2003 too. Thanks in advance.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,880

    Re: Paste file into multiple folders using a list of file paths

    Use FileCopy function.

    Ex:
    Please Login or Register  to view this content.
    Note that Source and Destination must be full path.
    If Source is static, you'd just need to loop over the range holding Destination values.
    https://docs.microsoft.com/en-us/dot...tframework-4.8

    This assumes by worksheet. You mean a workbook. If it's worksheet, you'd first need to use routine to export sheet and save it to a location.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Paste file into multiple folders using a list of file paths

    I have to paste a worksheet into each one of those folders
    You mean a file ??
    If yes where is this file ?
    - Battle without fear gives no glory - Just try

  4. #4
    Registered User
    Join Date
    02-25-2014
    Location
    Grand Rapids, MI
    MS-Off Ver
    Excel 2013
    Posts
    26

    Re: Paste file into multiple folders using a list of file paths

    Yes, I want to paste a file into a bunch of different folders. The file or workbook to copy is housed in the same folder as the Excel workbook containing the macro.

  5. #5
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Paste file into multiple folders using a list of file paths

    See next code
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    02-25-2014
    Location
    Grand Rapids, MI
    MS-Off Ver
    Excel 2013
    Posts
    26

    Re: Paste file into multiple folders using a list of file paths

    Thank you so much, you guys blow my mind with your level of expertise. That is awesome!

  7. #7
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Paste file into multiple folders using a list of file paths

    You're welcome, glad to help.

+ 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] 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
  2. Insert multiple pictures using VBA referencing file paths
    By Nickmac1212 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-01-2016, 01:27 PM
  3. Paste multiple folder/file paths into excel using VBA
    By sherlucky in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-24-2016, 05:01 PM
  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. Replies: 0
    Last Post: 10-20-2014, 07:25 AM
  6. loop through multiple folders and paste file name and if fileIsOpen status
    By dwx in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-27-2014, 10:49 AM
  7. Replies: 1
    Last Post: 10-17-2005, 04:05 AM

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