+ Reply to Thread
Results 1 to 5 of 5

Macro to move file to another folder based on the names

  1. #1
    Registered User
    Join Date
    06-03-2013
    Location
    Bnglr
    MS-Off Ver
    Excel 2007
    Posts
    25

    Macro to move file to another folder based on the names

    Hello friends,

    Need some help on macro. I have the files for each client on their names (eg; for the client AA, i have the file named AA.xls) on a particular folder.

    The requirement is, 1) have to create folder for each country for the respective clients and 2) move the files to the respective folders for which the client belongs to based on the sheet attached.

    File path is C:\Users\DD\Desktop\New Folder\AA.xls

    Destination is C:\Users\DD\Desktop\NewZiland\

    Can somebody help me with a macro for this.

    Many thanks in advance...

    Regards.
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to move file to another folder based on the names

    Do the folders destination folders need to be created?
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to move file to another folder based on the names

    If all the folders exist, then this should work:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-03-2013
    Location
    Bnglr
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Macro to move file to another folder based on the names

    Hi, Thanks for your effort. Unfortunately there are some challenges which i am facing. I think i should explain the case again for more clarity.

    The folders are existing there so no need to create those again.

    And the files with client's name is also ready with me.

    The macro should search for the respective folders and move the files with client name to the respective folders as per the sheet.

    Thanks in advance....

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to move file to another folder based on the names

    That's what that code above is designed to do based on the info given in post #1. Having read through the code, is there any part you don't understand?

+ 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