+ Reply to Thread
Results 1 to 5 of 5

Move multiple files from multiple folders to one folder via macro

  1. #1
    Registered User
    Join Date
    08-29-2010
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    83

    Move multiple files from multiple folders to one folder via macro

    Hi,

    I have multiple files in multiple folders and I want to move the files within each of the folders to one folder via a macro.
    The folders are any name.

    Existing folders names:
    Document saved as HTML file for anyemail.com (within this folder there are multiple html files)
    Document saved as HTML file for anyemail1.com (within this folder there are multiple html files)
    Document saved as HTML file for anyemail2.com (within this folder there are multiple html files)

    I want the macro to move the html files into another folder called s:\Documents

    Can you help me with this request?

    Thank you,
    Ash
    Last edited by nobleprince; 08-24-2016 at 06:43 PM.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,277

    Re: Move multiple files from multiple folders to one folder via macro

    Same idea as renaming - requires reference to MS Scripting... If you need to keep track of the source folder, you could create new folders in the destination folder or rename the file to include the original folder name....

    Please Login or Register  to view this content.
    Last edited by Bernie Deitrick; 08-24-2016 at 02:43 PM.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    08-29-2010
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: Move multiple files from multiple folders to one folder via macro

    The macro is moving the files across but is adding the name of the sub-folder to the beginning of each file when the files are moved across.

    The destination folder is S:\Folder_ A\Sub_Folder

    Please advise?

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,277

    Re: Move multiple files from multiple folders to one folder via macro

    That doesn't happen for me - what does the msgbox say when you use this (it won't actually move the files, just show the first one's name and folder):

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-29-2010
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: Move multiple files from multiple folders to one folder via macro

    Working OK now. There was a missing \ at the end of the folder path in macro.

    I am getting an error with the other macro http://www.excelforum.com/excel-prog...h-a-macro.html

+ 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] Macro to move all files from one folder to multiple folders
    By mhbealey in forum Excel Programming / VBA / Macros
    Replies: 27
    Last Post: 12-23-2015, 08:35 PM
  2. VBA code to move multiple files to different folders based on the file name
    By MissaLissa in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-07-2015, 10:19 AM
  3. Macro to move files from one folder to multiple
    By mishaq in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-30-2014, 04:27 AM
  4. Replies: 0
    Last Post: 11-28-2013, 12:03 PM
  5. Move Excel files from multiple folders to one
    By Azzzman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-04-2013, 10:21 AM
  6. Replies: 1
    Last Post: 02-29-2012, 01:15 PM
  7. move multiple files to multiple folders by their name
    By Nav123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-20-2011, 07:17 PM

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