+ Reply to Thread
Results 1 to 2 of 2

Search within subfolders to copy files to another folder

  1. #1
    Registered User
    Join Date
    05-20-2020
    Location
    USA
    MS-Off Ver
    10
    Posts
    28

    Search within subfolders to copy files to another folder

    Hello,


    I borrowed some code from the KuTools in order to copy files based on a selection of cells in Excel to another folder. How do I go about modifying the code to search within subfolders in the main folder that I point to?


    Example of usage of current code:

    1. I would have the file names in column A.

    2. I select the file names in column A and run the VB script

    3. I get a pop up asking for the folder for the Original Folder

    4. I point to the original folder

    5. I get a pop up asking for the destination folder

    6 Files get copied


    However in step 3, how to modify the code to get files from subfolders so that I can just point to the "Main Folder"?


    Folder Structure:

    Main Folder

    |

    |___________folder1

    |

    |___________folder2


    Any help will be sincerely appreciated!

    Thanks!



    Code

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Search within subfolders to copy files to another folder

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ 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 copy only excel files format in many subfolders to a single folder
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-15-2020, 03:03 PM
  2. Replies: 4
    Last Post: 09-30-2019, 03:47 PM
  3. copy or cut pdf files from folders and subfolders into one single folder
    By druva in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-25-2019, 01:27 PM
  4. VBA Copy specific files listed in Excel from folder & subfolders to another folder - FSO
    By HelloFriends in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-03-2019, 02:55 PM
  5. Copy files and delete current folder and subfolders
    By maym in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-24-2018, 10:34 PM
  6. Copy specific files from subfolders to new folder
    By dxl in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-28-2016, 06:06 PM
  7. Needs macro to copy excel files from folders, subfolders to new folder
    By genetist in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-08-2014, 08:53 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