+ Reply to Thread
Results 1 to 13 of 13

Moving subfolders to another folder.

  1. #1
    Registered User
    Join Date
    06-12-2012
    Location
    Verona, New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    22

    Question Moving subfolders to another folder.

    I have a folder named Directory. Within the Directory folder, there are about 3,000 subfolders. I have to pull out about 1,000 of these subfolders. Each subfolder is named after an employee; last name, first name.
    I have an Excel spreadsheet and in column A is the name of the employee that needs to be pulled out of the Directory folder. So for example, if Jones, Mary is in column A2, then the macro needs to identify Jones, Mary subfolder and move (not copy) the subfolder and its contents to another folder. So in the end, I will have a thousand subfolders in one folder. Also in Column B there are some employee ID numbers associated with each name in Column A. If there is an employee ID number, can that be attached to the file name, eg. Jones, Mary – 11223?

    If you have another idea on how to do this, I am open for suggestions. Thank you very much.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Moving subfolders to another folder.

    Completely untested:

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    06-12-2012
    Location
    Verona, New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Moving subfolders to another folder.

    Hi. Thank you but nothing is happening when I test this macro.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Moving subfolders to another folder.

    That's not much help.

    What's the exact code you're using? What happens when you step through it?

  5. #5
    Registered User
    Join Date
    06-12-2012
    Location
    Verona, New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Moving subfolders to another folder.

    I am using the code below. Changing the to and from path. No action occurs when i run it. No errors either.


    Please Login or Register  to view this content.
    Last edited by Leith Ross; 12-21-2012 at 10:49 PM. Reason: Added Code Tags

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Moving subfolders to another folder.

    You're missing the trailing path separators on the directories.

  7. #7
    Registered User
    Join Date
    06-12-2012
    Location
    Verona, New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Moving subfolders to another folder.

    OK.. I added the trailing path separators but still nothing is happening. I have the From folder sitting on my desktop as well to To folder. In the From folder I have a subfolder named Abbatiello,Phillip.

    Nothing is happening when I run the code below. I also uploaded the Excel file I am using.

    Please Login or Register  to view this content.
    .
    Attached Files Attached Files
    Last edited by Leith Ross; 12-22-2012 at 06:10 PM. Reason: Added Code Tags

  8. #8
    Registered User
    Join Date
    06-12-2012
    Location
    Verona, New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Moving subfolders to another folder.

    Hi. Also I found some VBA code that just moves subfolders to another folder. Does this help?

    Please Login or Register  to view this content.
    Last edited by Leith Ross; 12-22-2012 at 06:10 PM. Reason: Added Code Tags

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Moving subfolders to another folder.

    There's no extension in the filenames ...

  10. #10
    Registered User
    Join Date
    06-12-2012
    Location
    Verona, New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Moving subfolders to another folder.

    This is a folder name not a file.
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 12-22-2012 at 06:10 PM.

  11. #11
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Moving subfolders to another folder.

    I completely missed that.

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    06-12-2012
    Location
    Verona, New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Moving subfolders to another folder.

    Hi. Thank you this worked great.

  13. #13
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Moving subfolders to another folder.

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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