+ Reply to Thread
Results 1 to 2 of 2

Create folders and move corresponding files into folder using VBA

  1. #1
    Forum Contributor
    Join Date
    04-28-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    365
    Posts
    142

    Create folders and move corresponding files into folder using VBA

    I wish to sort a wide range of files based on the name after the final "_" into folders with the same name using VBA. As an example I have the following files;

    XYZ_Featurepoint_A_ABCD.dwg
    XYZ_Featurepoint_A_ABCD.dwg.xml
    XYZ_A_ABCD.dwg
    XYZ_A_ABCD.dwg.xml

    XYZ_Featurepoint_A_ABCDE.dwg
    XYZ_Featurepoint_A_ABCDE.dwg.xml
    XYZ_A_ABCDE.dwg
    XYZ_A_ABCDE.dwg.xml

    I want the script to first create folders based on the filename if a range of files in a folder based on whatever is after the last _, in this case ABCD and ABCDE. Then I want it to put the files with the same filename after the last _ which in this case is ABCD and ABCDE into the corresponding folders named the same (ABCD and ABCDE)

    Please advise

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Create folders and move corresponding files into folder using VBA


    Rather than a guessing challenge share the code you started to wrote or a least a better elaboration with details in order there is nothin' to guess.
    Edit : under Windows only ?

    See the below section Similar Threads …
    Last edited by Marc L; 05-11-2023 at 08:25 AM.

+ 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. Macro to move pdf files from folders and subfolders to another folder
    By buvanamali in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-21-2020, 11:51 AM
  2. [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
  3. Macro to Move Files from a Folder to Newly created folders based on value in a cell
    By acsishere in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-08-2015, 08:04 PM
  4. Replies: 0
    Last Post: 08-05-2015, 11:45 PM
  5. Create FOLDER in subfoldesr and move folders with specific names into FOLDER
    By Amarjeet Singh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-25-2015, 09:46 AM
  6. Create folder and move folders
    By Amarjeet Singh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-18-2015, 11:56 AM
  7. Create folders and move and copy files into that folders
    By vijaybharthi in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-31-2010, 04:01 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